
obj/user/faultread.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 21 00 00 00       	call   800052 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:

#include <inc/lib.h>

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	83 ec 10             	sub    $0x10,%esp
	cprintf("I read %08x from location 0!\n", *(unsigned*)0);
  80003d:	ff 35 00 00 00 00    	pushl  0x0
  800043:	68 e0 1e 80 00       	push   $0x801ee0
  800048:	e8 14 01 00 00       	call   800161 <cprintf>
}
  80004d:	83 c4 10             	add    $0x10,%esp
  800050:	c9                   	leave  
  800051:	c3                   	ret    

00800052 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  800052:	f3 0f 1e fb          	endbr32 
  800056:	55                   	push   %ebp
  800057:	89 e5                	mov    %esp,%ebp
  800059:	56                   	push   %esi
  80005a:	53                   	push   %ebx
  80005b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80005e:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  800061:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  800068:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  80006b:	e8 c6 0a 00 00       	call   800b36 <sys_getenvid>
  800070:	25 ff 03 00 00       	and    $0x3ff,%eax
  800075:	6b c0 7c             	imul   $0x7c,%eax,%eax
  800078:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  80007d:	a3 04 40 80 00       	mov    %eax,0x804004

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800082:	85 db                	test   %ebx,%ebx
  800084:	7e 07                	jle    80008d <libmain+0x3b>
		binaryname = argv[0];
  800086:	8b 06                	mov    (%esi),%eax
  800088:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  80008d:	83 ec 08             	sub    $0x8,%esp
  800090:	56                   	push   %esi
  800091:	53                   	push   %ebx
  800092:	e8 9c ff ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  800097:	e8 0a 00 00 00       	call   8000a6 <exit>
}
  80009c:	83 c4 10             	add    $0x10,%esp
  80009f:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8000a2:	5b                   	pop    %ebx
  8000a3:	5e                   	pop    %esi
  8000a4:	5d                   	pop    %ebp
  8000a5:	c3                   	ret    

008000a6 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  8000a6:	f3 0f 1e fb          	endbr32 
  8000aa:	55                   	push   %ebp
  8000ab:	89 e5                	mov    %esp,%ebp
  8000ad:	83 ec 08             	sub    $0x8,%esp
	close_all();
  8000b0:	e8 c7 0e 00 00       	call   800f7c <close_all>
	sys_env_destroy(0);
  8000b5:	83 ec 0c             	sub    $0xc,%esp
  8000b8:	6a 00                	push   $0x0
  8000ba:	e8 32 0a 00 00       	call   800af1 <sys_env_destroy>
}
  8000bf:	83 c4 10             	add    $0x10,%esp
  8000c2:	c9                   	leave  
  8000c3:	c3                   	ret    

008000c4 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  8000c4:	f3 0f 1e fb          	endbr32 
  8000c8:	55                   	push   %ebp
  8000c9:	89 e5                	mov    %esp,%ebp
  8000cb:	53                   	push   %ebx
  8000cc:	83 ec 04             	sub    $0x4,%esp
  8000cf:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  8000d2:	8b 13                	mov    (%ebx),%edx
  8000d4:	8d 42 01             	lea    0x1(%edx),%eax
  8000d7:	89 03                	mov    %eax,(%ebx)
  8000d9:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8000dc:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  8000e0:	3d ff 00 00 00       	cmp    $0xff,%eax
  8000e5:	74 09                	je     8000f0 <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  8000e7:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  8000eb:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8000ee:	c9                   	leave  
  8000ef:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  8000f0:	83 ec 08             	sub    $0x8,%esp
  8000f3:	68 ff 00 00 00       	push   $0xff
  8000f8:	8d 43 08             	lea    0x8(%ebx),%eax
  8000fb:	50                   	push   %eax
  8000fc:	e8 ab 09 00 00       	call   800aac <sys_cputs>
		b->idx = 0;
  800101:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  800107:	83 c4 10             	add    $0x10,%esp
  80010a:	eb db                	jmp    8000e7 <putch+0x23>

0080010c <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  80010c:	f3 0f 1e fb          	endbr32 
  800110:	55                   	push   %ebp
  800111:	89 e5                	mov    %esp,%ebp
  800113:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  800119:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  800120:	00 00 00 
	b.cnt = 0;
  800123:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  80012a:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  80012d:	ff 75 0c             	pushl  0xc(%ebp)
  800130:	ff 75 08             	pushl  0x8(%ebp)
  800133:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  800139:	50                   	push   %eax
  80013a:	68 c4 00 80 00       	push   $0x8000c4
  80013f:	e8 20 01 00 00       	call   800264 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800144:	83 c4 08             	add    $0x8,%esp
  800147:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  80014d:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  800153:	50                   	push   %eax
  800154:	e8 53 09 00 00       	call   800aac <sys_cputs>

	return b.cnt;
}
  800159:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  80015f:	c9                   	leave  
  800160:	c3                   	ret    

00800161 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  800161:	f3 0f 1e fb          	endbr32 
  800165:	55                   	push   %ebp
  800166:	89 e5                	mov    %esp,%ebp
  800168:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  80016b:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  80016e:	50                   	push   %eax
  80016f:	ff 75 08             	pushl  0x8(%ebp)
  800172:	e8 95 ff ff ff       	call   80010c <vcprintf>
	va_end(ap);

	return cnt;
}
  800177:	c9                   	leave  
  800178:	c3                   	ret    

00800179 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  800179:	55                   	push   %ebp
  80017a:	89 e5                	mov    %esp,%ebp
  80017c:	57                   	push   %edi
  80017d:	56                   	push   %esi
  80017e:	53                   	push   %ebx
  80017f:	83 ec 1c             	sub    $0x1c,%esp
  800182:	89 c7                	mov    %eax,%edi
  800184:	89 d6                	mov    %edx,%esi
  800186:	8b 45 08             	mov    0x8(%ebp),%eax
  800189:	8b 55 0c             	mov    0xc(%ebp),%edx
  80018c:	89 d1                	mov    %edx,%ecx
  80018e:	89 c2                	mov    %eax,%edx
  800190:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800193:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  800196:	8b 45 10             	mov    0x10(%ebp),%eax
  800199:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  80019c:	89 45 e0             	mov    %eax,-0x20(%ebp)
  80019f:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  8001a6:	39 c2                	cmp    %eax,%edx
  8001a8:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  8001ab:	72 3e                	jb     8001eb <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  8001ad:	83 ec 0c             	sub    $0xc,%esp
  8001b0:	ff 75 18             	pushl  0x18(%ebp)
  8001b3:	83 eb 01             	sub    $0x1,%ebx
  8001b6:	53                   	push   %ebx
  8001b7:	50                   	push   %eax
  8001b8:	83 ec 08             	sub    $0x8,%esp
  8001bb:	ff 75 e4             	pushl  -0x1c(%ebp)
  8001be:	ff 75 e0             	pushl  -0x20(%ebp)
  8001c1:	ff 75 dc             	pushl  -0x24(%ebp)
  8001c4:	ff 75 d8             	pushl  -0x28(%ebp)
  8001c7:	e8 b4 1a 00 00       	call   801c80 <__udivdi3>
  8001cc:	83 c4 18             	add    $0x18,%esp
  8001cf:	52                   	push   %edx
  8001d0:	50                   	push   %eax
  8001d1:	89 f2                	mov    %esi,%edx
  8001d3:	89 f8                	mov    %edi,%eax
  8001d5:	e8 9f ff ff ff       	call   800179 <printnum>
  8001da:	83 c4 20             	add    $0x20,%esp
  8001dd:	eb 13                	jmp    8001f2 <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  8001df:	83 ec 08             	sub    $0x8,%esp
  8001e2:	56                   	push   %esi
  8001e3:	ff 75 18             	pushl  0x18(%ebp)
  8001e6:	ff d7                	call   *%edi
  8001e8:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  8001eb:	83 eb 01             	sub    $0x1,%ebx
  8001ee:	85 db                	test   %ebx,%ebx
  8001f0:	7f ed                	jg     8001df <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  8001f2:	83 ec 08             	sub    $0x8,%esp
  8001f5:	56                   	push   %esi
  8001f6:	83 ec 04             	sub    $0x4,%esp
  8001f9:	ff 75 e4             	pushl  -0x1c(%ebp)
  8001fc:	ff 75 e0             	pushl  -0x20(%ebp)
  8001ff:	ff 75 dc             	pushl  -0x24(%ebp)
  800202:	ff 75 d8             	pushl  -0x28(%ebp)
  800205:	e8 86 1b 00 00       	call   801d90 <__umoddi3>
  80020a:	83 c4 14             	add    $0x14,%esp
  80020d:	0f be 80 08 1f 80 00 	movsbl 0x801f08(%eax),%eax
  800214:	50                   	push   %eax
  800215:	ff d7                	call   *%edi
}
  800217:	83 c4 10             	add    $0x10,%esp
  80021a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80021d:	5b                   	pop    %ebx
  80021e:	5e                   	pop    %esi
  80021f:	5f                   	pop    %edi
  800220:	5d                   	pop    %ebp
  800221:	c3                   	ret    

00800222 <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  800222:	f3 0f 1e fb          	endbr32 
  800226:	55                   	push   %ebp
  800227:	89 e5                	mov    %esp,%ebp
  800229:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  80022c:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  800230:	8b 10                	mov    (%eax),%edx
  800232:	3b 50 04             	cmp    0x4(%eax),%edx
  800235:	73 0a                	jae    800241 <sprintputch+0x1f>
		*b->buf++ = ch;
  800237:	8d 4a 01             	lea    0x1(%edx),%ecx
  80023a:	89 08                	mov    %ecx,(%eax)
  80023c:	8b 45 08             	mov    0x8(%ebp),%eax
  80023f:	88 02                	mov    %al,(%edx)
}
  800241:	5d                   	pop    %ebp
  800242:	c3                   	ret    

00800243 <printfmt>:
{
  800243:	f3 0f 1e fb          	endbr32 
  800247:	55                   	push   %ebp
  800248:	89 e5                	mov    %esp,%ebp
  80024a:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  80024d:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  800250:	50                   	push   %eax
  800251:	ff 75 10             	pushl  0x10(%ebp)
  800254:	ff 75 0c             	pushl  0xc(%ebp)
  800257:	ff 75 08             	pushl  0x8(%ebp)
  80025a:	e8 05 00 00 00       	call   800264 <vprintfmt>
}
  80025f:	83 c4 10             	add    $0x10,%esp
  800262:	c9                   	leave  
  800263:	c3                   	ret    

00800264 <vprintfmt>:
{
  800264:	f3 0f 1e fb          	endbr32 
  800268:	55                   	push   %ebp
  800269:	89 e5                	mov    %esp,%ebp
  80026b:	57                   	push   %edi
  80026c:	56                   	push   %esi
  80026d:	53                   	push   %ebx
  80026e:	83 ec 3c             	sub    $0x3c,%esp
  800271:	8b 75 08             	mov    0x8(%ebp),%esi
  800274:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  800277:	8b 7d 10             	mov    0x10(%ebp),%edi
  80027a:	e9 5d 03 00 00       	jmp    8005dc <vprintfmt+0x378>
		padc = ' ';
  80027f:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  800283:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  80028a:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  800291:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  800298:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  80029d:	8d 47 01             	lea    0x1(%edi),%eax
  8002a0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8002a3:	0f b6 17             	movzbl (%edi),%edx
  8002a6:	8d 42 dd             	lea    -0x23(%edx),%eax
  8002a9:	3c 55                	cmp    $0x55,%al
  8002ab:	0f 87 ae 03 00 00    	ja     80065f <vprintfmt+0x3fb>
  8002b1:	0f b6 c0             	movzbl %al,%eax
  8002b4:	3e ff 24 85 40 20 80 	notrack jmp *0x802040(,%eax,4)
  8002bb:	00 
  8002bc:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  8002bf:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  8002c3:	eb d8                	jmp    80029d <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8002c5:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  8002c8:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  8002cc:	eb cf                	jmp    80029d <vprintfmt+0x39>
  8002ce:	0f b6 d2             	movzbl %dl,%edx
  8002d1:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  8002d4:	b8 00 00 00 00       	mov    $0x0,%eax
  8002d9:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  8002dc:	8d 04 80             	lea    (%eax,%eax,4),%eax
  8002df:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  8002e3:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  8002e6:	8d 4a d0             	lea    -0x30(%edx),%ecx
  8002e9:	83 f9 09             	cmp    $0x9,%ecx
  8002ec:	77 55                	ja     800343 <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  8002ee:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  8002f1:	eb e9                	jmp    8002dc <vprintfmt+0x78>
			precision = va_arg(ap, int);
  8002f3:	8b 45 14             	mov    0x14(%ebp),%eax
  8002f6:	8b 00                	mov    (%eax),%eax
  8002f8:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8002fb:	8b 45 14             	mov    0x14(%ebp),%eax
  8002fe:	8d 40 04             	lea    0x4(%eax),%eax
  800301:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800304:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  800307:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  80030b:	79 90                	jns    80029d <vprintfmt+0x39>
				width = precision, precision = -1;
  80030d:	8b 45 d8             	mov    -0x28(%ebp),%eax
  800310:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  800313:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  80031a:	eb 81                	jmp    80029d <vprintfmt+0x39>
  80031c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  80031f:	85 c0                	test   %eax,%eax
  800321:	ba 00 00 00 00       	mov    $0x0,%edx
  800326:	0f 49 d0             	cmovns %eax,%edx
  800329:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  80032c:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  80032f:	e9 69 ff ff ff       	jmp    80029d <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800334:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  800337:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  80033e:	e9 5a ff ff ff       	jmp    80029d <vprintfmt+0x39>
  800343:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800346:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800349:	eb bc                	jmp    800307 <vprintfmt+0xa3>
			lflag++;
  80034b:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  80034e:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800351:	e9 47 ff ff ff       	jmp    80029d <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  800356:	8b 45 14             	mov    0x14(%ebp),%eax
  800359:	8d 78 04             	lea    0x4(%eax),%edi
  80035c:	83 ec 08             	sub    $0x8,%esp
  80035f:	53                   	push   %ebx
  800360:	ff 30                	pushl  (%eax)
  800362:	ff d6                	call   *%esi
			break;
  800364:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  800367:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  80036a:	e9 6a 02 00 00       	jmp    8005d9 <vprintfmt+0x375>
			err = va_arg(ap, int);
  80036f:	8b 45 14             	mov    0x14(%ebp),%eax
  800372:	8d 78 04             	lea    0x4(%eax),%edi
  800375:	8b 00                	mov    (%eax),%eax
  800377:	99                   	cltd   
  800378:	31 d0                	xor    %edx,%eax
  80037a:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  80037c:	83 f8 0f             	cmp    $0xf,%eax
  80037f:	7f 23                	jg     8003a4 <vprintfmt+0x140>
  800381:	8b 14 85 a0 21 80 00 	mov    0x8021a0(,%eax,4),%edx
  800388:	85 d2                	test   %edx,%edx
  80038a:	74 18                	je     8003a4 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  80038c:	52                   	push   %edx
  80038d:	68 d1 22 80 00       	push   $0x8022d1
  800392:	53                   	push   %ebx
  800393:	56                   	push   %esi
  800394:	e8 aa fe ff ff       	call   800243 <printfmt>
  800399:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  80039c:	89 7d 14             	mov    %edi,0x14(%ebp)
  80039f:	e9 35 02 00 00       	jmp    8005d9 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  8003a4:	50                   	push   %eax
  8003a5:	68 20 1f 80 00       	push   $0x801f20
  8003aa:	53                   	push   %ebx
  8003ab:	56                   	push   %esi
  8003ac:	e8 92 fe ff ff       	call   800243 <printfmt>
  8003b1:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8003b4:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  8003b7:	e9 1d 02 00 00       	jmp    8005d9 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  8003bc:	8b 45 14             	mov    0x14(%ebp),%eax
  8003bf:	83 c0 04             	add    $0x4,%eax
  8003c2:	89 45 c8             	mov    %eax,-0x38(%ebp)
  8003c5:	8b 45 14             	mov    0x14(%ebp),%eax
  8003c8:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  8003ca:	85 d2                	test   %edx,%edx
  8003cc:	b8 19 1f 80 00       	mov    $0x801f19,%eax
  8003d1:	0f 45 c2             	cmovne %edx,%eax
  8003d4:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  8003d7:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8003db:	7e 06                	jle    8003e3 <vprintfmt+0x17f>
  8003dd:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  8003e1:	75 0d                	jne    8003f0 <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  8003e3:	8b 45 cc             	mov    -0x34(%ebp),%eax
  8003e6:	89 c7                	mov    %eax,%edi
  8003e8:	03 45 d4             	add    -0x2c(%ebp),%eax
  8003eb:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8003ee:	eb 55                	jmp    800445 <vprintfmt+0x1e1>
  8003f0:	83 ec 08             	sub    $0x8,%esp
  8003f3:	ff 75 d8             	pushl  -0x28(%ebp)
  8003f6:	ff 75 cc             	pushl  -0x34(%ebp)
  8003f9:	e8 15 03 00 00       	call   800713 <strnlen>
  8003fe:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  800401:	29 c2                	sub    %eax,%edx
  800403:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  800406:	83 c4 10             	add    $0x10,%esp
  800409:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  80040b:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  80040f:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  800412:	85 ff                	test   %edi,%edi
  800414:	7e 11                	jle    800427 <vprintfmt+0x1c3>
					putch(padc, putdat);
  800416:	83 ec 08             	sub    $0x8,%esp
  800419:	53                   	push   %ebx
  80041a:	ff 75 d4             	pushl  -0x2c(%ebp)
  80041d:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  80041f:	83 ef 01             	sub    $0x1,%edi
  800422:	83 c4 10             	add    $0x10,%esp
  800425:	eb eb                	jmp    800412 <vprintfmt+0x1ae>
  800427:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  80042a:	85 d2                	test   %edx,%edx
  80042c:	b8 00 00 00 00       	mov    $0x0,%eax
  800431:	0f 49 c2             	cmovns %edx,%eax
  800434:	29 c2                	sub    %eax,%edx
  800436:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  800439:	eb a8                	jmp    8003e3 <vprintfmt+0x17f>
					putch(ch, putdat);
  80043b:	83 ec 08             	sub    $0x8,%esp
  80043e:	53                   	push   %ebx
  80043f:	52                   	push   %edx
  800440:	ff d6                	call   *%esi
  800442:	83 c4 10             	add    $0x10,%esp
  800445:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  800448:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  80044a:	83 c7 01             	add    $0x1,%edi
  80044d:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800451:	0f be d0             	movsbl %al,%edx
  800454:	85 d2                	test   %edx,%edx
  800456:	74 4b                	je     8004a3 <vprintfmt+0x23f>
  800458:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  80045c:	78 06                	js     800464 <vprintfmt+0x200>
  80045e:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  800462:	78 1e                	js     800482 <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  800464:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  800468:	74 d1                	je     80043b <vprintfmt+0x1d7>
  80046a:	0f be c0             	movsbl %al,%eax
  80046d:	83 e8 20             	sub    $0x20,%eax
  800470:	83 f8 5e             	cmp    $0x5e,%eax
  800473:	76 c6                	jbe    80043b <vprintfmt+0x1d7>
					putch('?', putdat);
  800475:	83 ec 08             	sub    $0x8,%esp
  800478:	53                   	push   %ebx
  800479:	6a 3f                	push   $0x3f
  80047b:	ff d6                	call   *%esi
  80047d:	83 c4 10             	add    $0x10,%esp
  800480:	eb c3                	jmp    800445 <vprintfmt+0x1e1>
  800482:	89 cf                	mov    %ecx,%edi
  800484:	eb 0e                	jmp    800494 <vprintfmt+0x230>
				putch(' ', putdat);
  800486:	83 ec 08             	sub    $0x8,%esp
  800489:	53                   	push   %ebx
  80048a:	6a 20                	push   $0x20
  80048c:	ff d6                	call   *%esi
			for (; width > 0; width--)
  80048e:	83 ef 01             	sub    $0x1,%edi
  800491:	83 c4 10             	add    $0x10,%esp
  800494:	85 ff                	test   %edi,%edi
  800496:	7f ee                	jg     800486 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  800498:	8b 45 c8             	mov    -0x38(%ebp),%eax
  80049b:	89 45 14             	mov    %eax,0x14(%ebp)
  80049e:	e9 36 01 00 00       	jmp    8005d9 <vprintfmt+0x375>
  8004a3:	89 cf                	mov    %ecx,%edi
  8004a5:	eb ed                	jmp    800494 <vprintfmt+0x230>
	if (lflag >= 2)
  8004a7:	83 f9 01             	cmp    $0x1,%ecx
  8004aa:	7f 1f                	jg     8004cb <vprintfmt+0x267>
	else if (lflag)
  8004ac:	85 c9                	test   %ecx,%ecx
  8004ae:	74 67                	je     800517 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  8004b0:	8b 45 14             	mov    0x14(%ebp),%eax
  8004b3:	8b 00                	mov    (%eax),%eax
  8004b5:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8004b8:	89 c1                	mov    %eax,%ecx
  8004ba:	c1 f9 1f             	sar    $0x1f,%ecx
  8004bd:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8004c0:	8b 45 14             	mov    0x14(%ebp),%eax
  8004c3:	8d 40 04             	lea    0x4(%eax),%eax
  8004c6:	89 45 14             	mov    %eax,0x14(%ebp)
  8004c9:	eb 17                	jmp    8004e2 <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  8004cb:	8b 45 14             	mov    0x14(%ebp),%eax
  8004ce:	8b 50 04             	mov    0x4(%eax),%edx
  8004d1:	8b 00                	mov    (%eax),%eax
  8004d3:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8004d6:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8004d9:	8b 45 14             	mov    0x14(%ebp),%eax
  8004dc:	8d 40 08             	lea    0x8(%eax),%eax
  8004df:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  8004e2:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8004e5:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  8004e8:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  8004ed:	85 c9                	test   %ecx,%ecx
  8004ef:	0f 89 ca 00 00 00    	jns    8005bf <vprintfmt+0x35b>
				putch('-', putdat);
  8004f5:	83 ec 08             	sub    $0x8,%esp
  8004f8:	53                   	push   %ebx
  8004f9:	6a 2d                	push   $0x2d
  8004fb:	ff d6                	call   *%esi
				num = -(long long) num;
  8004fd:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800500:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  800503:	f7 da                	neg    %edx
  800505:	83 d1 00             	adc    $0x0,%ecx
  800508:	f7 d9                	neg    %ecx
  80050a:	83 c4 10             	add    $0x10,%esp
			base = 10;
  80050d:	b8 0a 00 00 00       	mov    $0xa,%eax
  800512:	e9 a8 00 00 00       	jmp    8005bf <vprintfmt+0x35b>
		return va_arg(*ap, int);
  800517:	8b 45 14             	mov    0x14(%ebp),%eax
  80051a:	8b 00                	mov    (%eax),%eax
  80051c:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80051f:	99                   	cltd   
  800520:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800523:	8b 45 14             	mov    0x14(%ebp),%eax
  800526:	8d 40 04             	lea    0x4(%eax),%eax
  800529:	89 45 14             	mov    %eax,0x14(%ebp)
  80052c:	eb b4                	jmp    8004e2 <vprintfmt+0x27e>
	if (lflag >= 2)
  80052e:	83 f9 01             	cmp    $0x1,%ecx
  800531:	7f 1b                	jg     80054e <vprintfmt+0x2ea>
	else if (lflag)
  800533:	85 c9                	test   %ecx,%ecx
  800535:	74 2c                	je     800563 <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  800537:	8b 45 14             	mov    0x14(%ebp),%eax
  80053a:	8b 10                	mov    (%eax),%edx
  80053c:	b9 00 00 00 00       	mov    $0x0,%ecx
  800541:	8d 40 04             	lea    0x4(%eax),%eax
  800544:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800547:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  80054c:	eb 71                	jmp    8005bf <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  80054e:	8b 45 14             	mov    0x14(%ebp),%eax
  800551:	8b 10                	mov    (%eax),%edx
  800553:	8b 48 04             	mov    0x4(%eax),%ecx
  800556:	8d 40 08             	lea    0x8(%eax),%eax
  800559:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80055c:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  800561:	eb 5c                	jmp    8005bf <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800563:	8b 45 14             	mov    0x14(%ebp),%eax
  800566:	8b 10                	mov    (%eax),%edx
  800568:	b9 00 00 00 00       	mov    $0x0,%ecx
  80056d:	8d 40 04             	lea    0x4(%eax),%eax
  800570:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800573:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  800578:	eb 45                	jmp    8005bf <vprintfmt+0x35b>
			putch('X', putdat);
  80057a:	83 ec 08             	sub    $0x8,%esp
  80057d:	53                   	push   %ebx
  80057e:	6a 58                	push   $0x58
  800580:	ff d6                	call   *%esi
			putch('X', putdat);
  800582:	83 c4 08             	add    $0x8,%esp
  800585:	53                   	push   %ebx
  800586:	6a 58                	push   $0x58
  800588:	ff d6                	call   *%esi
			putch('X', putdat);
  80058a:	83 c4 08             	add    $0x8,%esp
  80058d:	53                   	push   %ebx
  80058e:	6a 58                	push   $0x58
  800590:	ff d6                	call   *%esi
			break;
  800592:	83 c4 10             	add    $0x10,%esp
  800595:	eb 42                	jmp    8005d9 <vprintfmt+0x375>
			putch('0', putdat);
  800597:	83 ec 08             	sub    $0x8,%esp
  80059a:	53                   	push   %ebx
  80059b:	6a 30                	push   $0x30
  80059d:	ff d6                	call   *%esi
			putch('x', putdat);
  80059f:	83 c4 08             	add    $0x8,%esp
  8005a2:	53                   	push   %ebx
  8005a3:	6a 78                	push   $0x78
  8005a5:	ff d6                	call   *%esi
			num = (unsigned long long)
  8005a7:	8b 45 14             	mov    0x14(%ebp),%eax
  8005aa:	8b 10                	mov    (%eax),%edx
  8005ac:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  8005b1:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  8005b4:	8d 40 04             	lea    0x4(%eax),%eax
  8005b7:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8005ba:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  8005bf:	83 ec 0c             	sub    $0xc,%esp
  8005c2:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  8005c6:	57                   	push   %edi
  8005c7:	ff 75 d4             	pushl  -0x2c(%ebp)
  8005ca:	50                   	push   %eax
  8005cb:	51                   	push   %ecx
  8005cc:	52                   	push   %edx
  8005cd:	89 da                	mov    %ebx,%edx
  8005cf:	89 f0                	mov    %esi,%eax
  8005d1:	e8 a3 fb ff ff       	call   800179 <printnum>
			break;
  8005d6:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  8005d9:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  8005dc:	83 c7 01             	add    $0x1,%edi
  8005df:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  8005e3:	83 f8 25             	cmp    $0x25,%eax
  8005e6:	0f 84 93 fc ff ff    	je     80027f <vprintfmt+0x1b>
			if (ch == '\0')
  8005ec:	85 c0                	test   %eax,%eax
  8005ee:	0f 84 8b 00 00 00    	je     80067f <vprintfmt+0x41b>
			putch(ch, putdat);
  8005f4:	83 ec 08             	sub    $0x8,%esp
  8005f7:	53                   	push   %ebx
  8005f8:	50                   	push   %eax
  8005f9:	ff d6                	call   *%esi
  8005fb:	83 c4 10             	add    $0x10,%esp
  8005fe:	eb dc                	jmp    8005dc <vprintfmt+0x378>
	if (lflag >= 2)
  800600:	83 f9 01             	cmp    $0x1,%ecx
  800603:	7f 1b                	jg     800620 <vprintfmt+0x3bc>
	else if (lflag)
  800605:	85 c9                	test   %ecx,%ecx
  800607:	74 2c                	je     800635 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  800609:	8b 45 14             	mov    0x14(%ebp),%eax
  80060c:	8b 10                	mov    (%eax),%edx
  80060e:	b9 00 00 00 00       	mov    $0x0,%ecx
  800613:	8d 40 04             	lea    0x4(%eax),%eax
  800616:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800619:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  80061e:	eb 9f                	jmp    8005bf <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800620:	8b 45 14             	mov    0x14(%ebp),%eax
  800623:	8b 10                	mov    (%eax),%edx
  800625:	8b 48 04             	mov    0x4(%eax),%ecx
  800628:	8d 40 08             	lea    0x8(%eax),%eax
  80062b:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80062e:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  800633:	eb 8a                	jmp    8005bf <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800635:	8b 45 14             	mov    0x14(%ebp),%eax
  800638:	8b 10                	mov    (%eax),%edx
  80063a:	b9 00 00 00 00       	mov    $0x0,%ecx
  80063f:	8d 40 04             	lea    0x4(%eax),%eax
  800642:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800645:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  80064a:	e9 70 ff ff ff       	jmp    8005bf <vprintfmt+0x35b>
			putch(ch, putdat);
  80064f:	83 ec 08             	sub    $0x8,%esp
  800652:	53                   	push   %ebx
  800653:	6a 25                	push   $0x25
  800655:	ff d6                	call   *%esi
			break;
  800657:	83 c4 10             	add    $0x10,%esp
  80065a:	e9 7a ff ff ff       	jmp    8005d9 <vprintfmt+0x375>
			putch('%', putdat);
  80065f:	83 ec 08             	sub    $0x8,%esp
  800662:	53                   	push   %ebx
  800663:	6a 25                	push   $0x25
  800665:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  800667:	83 c4 10             	add    $0x10,%esp
  80066a:	89 f8                	mov    %edi,%eax
  80066c:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  800670:	74 05                	je     800677 <vprintfmt+0x413>
  800672:	83 e8 01             	sub    $0x1,%eax
  800675:	eb f5                	jmp    80066c <vprintfmt+0x408>
  800677:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80067a:	e9 5a ff ff ff       	jmp    8005d9 <vprintfmt+0x375>
}
  80067f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800682:	5b                   	pop    %ebx
  800683:	5e                   	pop    %esi
  800684:	5f                   	pop    %edi
  800685:	5d                   	pop    %ebp
  800686:	c3                   	ret    

00800687 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  800687:	f3 0f 1e fb          	endbr32 
  80068b:	55                   	push   %ebp
  80068c:	89 e5                	mov    %esp,%ebp
  80068e:	83 ec 18             	sub    $0x18,%esp
  800691:	8b 45 08             	mov    0x8(%ebp),%eax
  800694:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  800697:	89 45 ec             	mov    %eax,-0x14(%ebp)
  80069a:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  80069e:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  8006a1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  8006a8:	85 c0                	test   %eax,%eax
  8006aa:	74 26                	je     8006d2 <vsnprintf+0x4b>
  8006ac:	85 d2                	test   %edx,%edx
  8006ae:	7e 22                	jle    8006d2 <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  8006b0:	ff 75 14             	pushl  0x14(%ebp)
  8006b3:	ff 75 10             	pushl  0x10(%ebp)
  8006b6:	8d 45 ec             	lea    -0x14(%ebp),%eax
  8006b9:	50                   	push   %eax
  8006ba:	68 22 02 80 00       	push   $0x800222
  8006bf:	e8 a0 fb ff ff       	call   800264 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  8006c4:	8b 45 ec             	mov    -0x14(%ebp),%eax
  8006c7:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  8006ca:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8006cd:	83 c4 10             	add    $0x10,%esp
}
  8006d0:	c9                   	leave  
  8006d1:	c3                   	ret    
		return -E_INVAL;
  8006d2:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8006d7:	eb f7                	jmp    8006d0 <vsnprintf+0x49>

008006d9 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  8006d9:	f3 0f 1e fb          	endbr32 
  8006dd:	55                   	push   %ebp
  8006de:	89 e5                	mov    %esp,%ebp
  8006e0:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  8006e3:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  8006e6:	50                   	push   %eax
  8006e7:	ff 75 10             	pushl  0x10(%ebp)
  8006ea:	ff 75 0c             	pushl  0xc(%ebp)
  8006ed:	ff 75 08             	pushl  0x8(%ebp)
  8006f0:	e8 92 ff ff ff       	call   800687 <vsnprintf>
	va_end(ap);

	return rc;
}
  8006f5:	c9                   	leave  
  8006f6:	c3                   	ret    

008006f7 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  8006f7:	f3 0f 1e fb          	endbr32 
  8006fb:	55                   	push   %ebp
  8006fc:	89 e5                	mov    %esp,%ebp
  8006fe:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  800701:	b8 00 00 00 00       	mov    $0x0,%eax
  800706:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  80070a:	74 05                	je     800711 <strlen+0x1a>
		n++;
  80070c:	83 c0 01             	add    $0x1,%eax
  80070f:	eb f5                	jmp    800706 <strlen+0xf>
	return n;
}
  800711:	5d                   	pop    %ebp
  800712:	c3                   	ret    

00800713 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  800713:	f3 0f 1e fb          	endbr32 
  800717:	55                   	push   %ebp
  800718:	89 e5                	mov    %esp,%ebp
  80071a:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80071d:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  800720:	b8 00 00 00 00       	mov    $0x0,%eax
  800725:	39 d0                	cmp    %edx,%eax
  800727:	74 0d                	je     800736 <strnlen+0x23>
  800729:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  80072d:	74 05                	je     800734 <strnlen+0x21>
		n++;
  80072f:	83 c0 01             	add    $0x1,%eax
  800732:	eb f1                	jmp    800725 <strnlen+0x12>
  800734:	89 c2                	mov    %eax,%edx
	return n;
}
  800736:	89 d0                	mov    %edx,%eax
  800738:	5d                   	pop    %ebp
  800739:	c3                   	ret    

0080073a <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  80073a:	f3 0f 1e fb          	endbr32 
  80073e:	55                   	push   %ebp
  80073f:	89 e5                	mov    %esp,%ebp
  800741:	53                   	push   %ebx
  800742:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800745:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800748:	b8 00 00 00 00       	mov    $0x0,%eax
  80074d:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  800751:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  800754:	83 c0 01             	add    $0x1,%eax
  800757:	84 d2                	test   %dl,%dl
  800759:	75 f2                	jne    80074d <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  80075b:	89 c8                	mov    %ecx,%eax
  80075d:	5b                   	pop    %ebx
  80075e:	5d                   	pop    %ebp
  80075f:	c3                   	ret    

00800760 <strcat>:

char *
strcat(char *dst, const char *src)
{
  800760:	f3 0f 1e fb          	endbr32 
  800764:	55                   	push   %ebp
  800765:	89 e5                	mov    %esp,%ebp
  800767:	53                   	push   %ebx
  800768:	83 ec 10             	sub    $0x10,%esp
  80076b:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  80076e:	53                   	push   %ebx
  80076f:	e8 83 ff ff ff       	call   8006f7 <strlen>
  800774:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  800777:	ff 75 0c             	pushl  0xc(%ebp)
  80077a:	01 d8                	add    %ebx,%eax
  80077c:	50                   	push   %eax
  80077d:	e8 b8 ff ff ff       	call   80073a <strcpy>
	return dst;
}
  800782:	89 d8                	mov    %ebx,%eax
  800784:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800787:	c9                   	leave  
  800788:	c3                   	ret    

00800789 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  800789:	f3 0f 1e fb          	endbr32 
  80078d:	55                   	push   %ebp
  80078e:	89 e5                	mov    %esp,%ebp
  800790:	56                   	push   %esi
  800791:	53                   	push   %ebx
  800792:	8b 75 08             	mov    0x8(%ebp),%esi
  800795:	8b 55 0c             	mov    0xc(%ebp),%edx
  800798:	89 f3                	mov    %esi,%ebx
  80079a:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  80079d:	89 f0                	mov    %esi,%eax
  80079f:	39 d8                	cmp    %ebx,%eax
  8007a1:	74 11                	je     8007b4 <strncpy+0x2b>
		*dst++ = *src;
  8007a3:	83 c0 01             	add    $0x1,%eax
  8007a6:	0f b6 0a             	movzbl (%edx),%ecx
  8007a9:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  8007ac:	80 f9 01             	cmp    $0x1,%cl
  8007af:	83 da ff             	sbb    $0xffffffff,%edx
  8007b2:	eb eb                	jmp    80079f <strncpy+0x16>
	}
	return ret;
}
  8007b4:	89 f0                	mov    %esi,%eax
  8007b6:	5b                   	pop    %ebx
  8007b7:	5e                   	pop    %esi
  8007b8:	5d                   	pop    %ebp
  8007b9:	c3                   	ret    

008007ba <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  8007ba:	f3 0f 1e fb          	endbr32 
  8007be:	55                   	push   %ebp
  8007bf:	89 e5                	mov    %esp,%ebp
  8007c1:	56                   	push   %esi
  8007c2:	53                   	push   %ebx
  8007c3:	8b 75 08             	mov    0x8(%ebp),%esi
  8007c6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8007c9:	8b 55 10             	mov    0x10(%ebp),%edx
  8007cc:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  8007ce:	85 d2                	test   %edx,%edx
  8007d0:	74 21                	je     8007f3 <strlcpy+0x39>
  8007d2:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  8007d6:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  8007d8:	39 c2                	cmp    %eax,%edx
  8007da:	74 14                	je     8007f0 <strlcpy+0x36>
  8007dc:	0f b6 19             	movzbl (%ecx),%ebx
  8007df:	84 db                	test   %bl,%bl
  8007e1:	74 0b                	je     8007ee <strlcpy+0x34>
			*dst++ = *src++;
  8007e3:	83 c1 01             	add    $0x1,%ecx
  8007e6:	83 c2 01             	add    $0x1,%edx
  8007e9:	88 5a ff             	mov    %bl,-0x1(%edx)
  8007ec:	eb ea                	jmp    8007d8 <strlcpy+0x1e>
  8007ee:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  8007f0:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  8007f3:	29 f0                	sub    %esi,%eax
}
  8007f5:	5b                   	pop    %ebx
  8007f6:	5e                   	pop    %esi
  8007f7:	5d                   	pop    %ebp
  8007f8:	c3                   	ret    

008007f9 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  8007f9:	f3 0f 1e fb          	endbr32 
  8007fd:	55                   	push   %ebp
  8007fe:	89 e5                	mov    %esp,%ebp
  800800:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800803:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800806:	0f b6 01             	movzbl (%ecx),%eax
  800809:	84 c0                	test   %al,%al
  80080b:	74 0c                	je     800819 <strcmp+0x20>
  80080d:	3a 02                	cmp    (%edx),%al
  80080f:	75 08                	jne    800819 <strcmp+0x20>
		p++, q++;
  800811:	83 c1 01             	add    $0x1,%ecx
  800814:	83 c2 01             	add    $0x1,%edx
  800817:	eb ed                	jmp    800806 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  800819:	0f b6 c0             	movzbl %al,%eax
  80081c:	0f b6 12             	movzbl (%edx),%edx
  80081f:	29 d0                	sub    %edx,%eax
}
  800821:	5d                   	pop    %ebp
  800822:	c3                   	ret    

00800823 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800823:	f3 0f 1e fb          	endbr32 
  800827:	55                   	push   %ebp
  800828:	89 e5                	mov    %esp,%ebp
  80082a:	53                   	push   %ebx
  80082b:	8b 45 08             	mov    0x8(%ebp),%eax
  80082e:	8b 55 0c             	mov    0xc(%ebp),%edx
  800831:	89 c3                	mov    %eax,%ebx
  800833:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800836:	eb 06                	jmp    80083e <strncmp+0x1b>
		n--, p++, q++;
  800838:	83 c0 01             	add    $0x1,%eax
  80083b:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  80083e:	39 d8                	cmp    %ebx,%eax
  800840:	74 16                	je     800858 <strncmp+0x35>
  800842:	0f b6 08             	movzbl (%eax),%ecx
  800845:	84 c9                	test   %cl,%cl
  800847:	74 04                	je     80084d <strncmp+0x2a>
  800849:	3a 0a                	cmp    (%edx),%cl
  80084b:	74 eb                	je     800838 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  80084d:	0f b6 00             	movzbl (%eax),%eax
  800850:	0f b6 12             	movzbl (%edx),%edx
  800853:	29 d0                	sub    %edx,%eax
}
  800855:	5b                   	pop    %ebx
  800856:	5d                   	pop    %ebp
  800857:	c3                   	ret    
		return 0;
  800858:	b8 00 00 00 00       	mov    $0x0,%eax
  80085d:	eb f6                	jmp    800855 <strncmp+0x32>

0080085f <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  80085f:	f3 0f 1e fb          	endbr32 
  800863:	55                   	push   %ebp
  800864:	89 e5                	mov    %esp,%ebp
  800866:	8b 45 08             	mov    0x8(%ebp),%eax
  800869:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80086d:	0f b6 10             	movzbl (%eax),%edx
  800870:	84 d2                	test   %dl,%dl
  800872:	74 09                	je     80087d <strchr+0x1e>
		if (*s == c)
  800874:	38 ca                	cmp    %cl,%dl
  800876:	74 0a                	je     800882 <strchr+0x23>
	for (; *s; s++)
  800878:	83 c0 01             	add    $0x1,%eax
  80087b:	eb f0                	jmp    80086d <strchr+0xe>
			return (char *) s;
	return 0;
  80087d:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800882:	5d                   	pop    %ebp
  800883:	c3                   	ret    

00800884 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  800884:	f3 0f 1e fb          	endbr32 
  800888:	55                   	push   %ebp
  800889:	89 e5                	mov    %esp,%ebp
  80088b:	8b 45 08             	mov    0x8(%ebp),%eax
  80088e:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  800892:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  800895:	38 ca                	cmp    %cl,%dl
  800897:	74 09                	je     8008a2 <strfind+0x1e>
  800899:	84 d2                	test   %dl,%dl
  80089b:	74 05                	je     8008a2 <strfind+0x1e>
	for (; *s; s++)
  80089d:	83 c0 01             	add    $0x1,%eax
  8008a0:	eb f0                	jmp    800892 <strfind+0xe>
			break;
	return (char *) s;
}
  8008a2:	5d                   	pop    %ebp
  8008a3:	c3                   	ret    

008008a4 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  8008a4:	f3 0f 1e fb          	endbr32 
  8008a8:	55                   	push   %ebp
  8008a9:	89 e5                	mov    %esp,%ebp
  8008ab:	57                   	push   %edi
  8008ac:	56                   	push   %esi
  8008ad:	53                   	push   %ebx
  8008ae:	8b 7d 08             	mov    0x8(%ebp),%edi
  8008b1:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  8008b4:	85 c9                	test   %ecx,%ecx
  8008b6:	74 31                	je     8008e9 <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  8008b8:	89 f8                	mov    %edi,%eax
  8008ba:	09 c8                	or     %ecx,%eax
  8008bc:	a8 03                	test   $0x3,%al
  8008be:	75 23                	jne    8008e3 <memset+0x3f>
		c &= 0xFF;
  8008c0:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  8008c4:	89 d3                	mov    %edx,%ebx
  8008c6:	c1 e3 08             	shl    $0x8,%ebx
  8008c9:	89 d0                	mov    %edx,%eax
  8008cb:	c1 e0 18             	shl    $0x18,%eax
  8008ce:	89 d6                	mov    %edx,%esi
  8008d0:	c1 e6 10             	shl    $0x10,%esi
  8008d3:	09 f0                	or     %esi,%eax
  8008d5:	09 c2                	or     %eax,%edx
  8008d7:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  8008d9:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  8008dc:	89 d0                	mov    %edx,%eax
  8008de:	fc                   	cld    
  8008df:	f3 ab                	rep stos %eax,%es:(%edi)
  8008e1:	eb 06                	jmp    8008e9 <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  8008e3:	8b 45 0c             	mov    0xc(%ebp),%eax
  8008e6:	fc                   	cld    
  8008e7:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  8008e9:	89 f8                	mov    %edi,%eax
  8008eb:	5b                   	pop    %ebx
  8008ec:	5e                   	pop    %esi
  8008ed:	5f                   	pop    %edi
  8008ee:	5d                   	pop    %ebp
  8008ef:	c3                   	ret    

008008f0 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  8008f0:	f3 0f 1e fb          	endbr32 
  8008f4:	55                   	push   %ebp
  8008f5:	89 e5                	mov    %esp,%ebp
  8008f7:	57                   	push   %edi
  8008f8:	56                   	push   %esi
  8008f9:	8b 45 08             	mov    0x8(%ebp),%eax
  8008fc:	8b 75 0c             	mov    0xc(%ebp),%esi
  8008ff:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800902:	39 c6                	cmp    %eax,%esi
  800904:	73 32                	jae    800938 <memmove+0x48>
  800906:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  800909:	39 c2                	cmp    %eax,%edx
  80090b:	76 2b                	jbe    800938 <memmove+0x48>
		s += n;
		d += n;
  80090d:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800910:	89 fe                	mov    %edi,%esi
  800912:	09 ce                	or     %ecx,%esi
  800914:	09 d6                	or     %edx,%esi
  800916:	f7 c6 03 00 00 00    	test   $0x3,%esi
  80091c:	75 0e                	jne    80092c <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  80091e:	83 ef 04             	sub    $0x4,%edi
  800921:	8d 72 fc             	lea    -0x4(%edx),%esi
  800924:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  800927:	fd                   	std    
  800928:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80092a:	eb 09                	jmp    800935 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  80092c:	83 ef 01             	sub    $0x1,%edi
  80092f:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800932:	fd                   	std    
  800933:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800935:	fc                   	cld    
  800936:	eb 1a                	jmp    800952 <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800938:	89 c2                	mov    %eax,%edx
  80093a:	09 ca                	or     %ecx,%edx
  80093c:	09 f2                	or     %esi,%edx
  80093e:	f6 c2 03             	test   $0x3,%dl
  800941:	75 0a                	jne    80094d <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800943:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800946:	89 c7                	mov    %eax,%edi
  800948:	fc                   	cld    
  800949:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80094b:	eb 05                	jmp    800952 <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  80094d:	89 c7                	mov    %eax,%edi
  80094f:	fc                   	cld    
  800950:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800952:	5e                   	pop    %esi
  800953:	5f                   	pop    %edi
  800954:	5d                   	pop    %ebp
  800955:	c3                   	ret    

00800956 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800956:	f3 0f 1e fb          	endbr32 
  80095a:	55                   	push   %ebp
  80095b:	89 e5                	mov    %esp,%ebp
  80095d:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800960:	ff 75 10             	pushl  0x10(%ebp)
  800963:	ff 75 0c             	pushl  0xc(%ebp)
  800966:	ff 75 08             	pushl  0x8(%ebp)
  800969:	e8 82 ff ff ff       	call   8008f0 <memmove>
}
  80096e:	c9                   	leave  
  80096f:	c3                   	ret    

00800970 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800970:	f3 0f 1e fb          	endbr32 
  800974:	55                   	push   %ebp
  800975:	89 e5                	mov    %esp,%ebp
  800977:	56                   	push   %esi
  800978:	53                   	push   %ebx
  800979:	8b 45 08             	mov    0x8(%ebp),%eax
  80097c:	8b 55 0c             	mov    0xc(%ebp),%edx
  80097f:	89 c6                	mov    %eax,%esi
  800981:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  800984:	39 f0                	cmp    %esi,%eax
  800986:	74 1c                	je     8009a4 <memcmp+0x34>
		if (*s1 != *s2)
  800988:	0f b6 08             	movzbl (%eax),%ecx
  80098b:	0f b6 1a             	movzbl (%edx),%ebx
  80098e:	38 d9                	cmp    %bl,%cl
  800990:	75 08                	jne    80099a <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  800992:	83 c0 01             	add    $0x1,%eax
  800995:	83 c2 01             	add    $0x1,%edx
  800998:	eb ea                	jmp    800984 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  80099a:	0f b6 c1             	movzbl %cl,%eax
  80099d:	0f b6 db             	movzbl %bl,%ebx
  8009a0:	29 d8                	sub    %ebx,%eax
  8009a2:	eb 05                	jmp    8009a9 <memcmp+0x39>
	}

	return 0;
  8009a4:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8009a9:	5b                   	pop    %ebx
  8009aa:	5e                   	pop    %esi
  8009ab:	5d                   	pop    %ebp
  8009ac:	c3                   	ret    

008009ad <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  8009ad:	f3 0f 1e fb          	endbr32 
  8009b1:	55                   	push   %ebp
  8009b2:	89 e5                	mov    %esp,%ebp
  8009b4:	8b 45 08             	mov    0x8(%ebp),%eax
  8009b7:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  8009ba:	89 c2                	mov    %eax,%edx
  8009bc:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  8009bf:	39 d0                	cmp    %edx,%eax
  8009c1:	73 09                	jae    8009cc <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  8009c3:	38 08                	cmp    %cl,(%eax)
  8009c5:	74 05                	je     8009cc <memfind+0x1f>
	for (; s < ends; s++)
  8009c7:	83 c0 01             	add    $0x1,%eax
  8009ca:	eb f3                	jmp    8009bf <memfind+0x12>
			break;
	return (void *) s;
}
  8009cc:	5d                   	pop    %ebp
  8009cd:	c3                   	ret    

008009ce <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  8009ce:	f3 0f 1e fb          	endbr32 
  8009d2:	55                   	push   %ebp
  8009d3:	89 e5                	mov    %esp,%ebp
  8009d5:	57                   	push   %edi
  8009d6:	56                   	push   %esi
  8009d7:	53                   	push   %ebx
  8009d8:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8009db:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  8009de:	eb 03                	jmp    8009e3 <strtol+0x15>
		s++;
  8009e0:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  8009e3:	0f b6 01             	movzbl (%ecx),%eax
  8009e6:	3c 20                	cmp    $0x20,%al
  8009e8:	74 f6                	je     8009e0 <strtol+0x12>
  8009ea:	3c 09                	cmp    $0x9,%al
  8009ec:	74 f2                	je     8009e0 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  8009ee:	3c 2b                	cmp    $0x2b,%al
  8009f0:	74 2a                	je     800a1c <strtol+0x4e>
	int neg = 0;
  8009f2:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  8009f7:	3c 2d                	cmp    $0x2d,%al
  8009f9:	74 2b                	je     800a26 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  8009fb:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800a01:	75 0f                	jne    800a12 <strtol+0x44>
  800a03:	80 39 30             	cmpb   $0x30,(%ecx)
  800a06:	74 28                	je     800a30 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800a08:	85 db                	test   %ebx,%ebx
  800a0a:	b8 0a 00 00 00       	mov    $0xa,%eax
  800a0f:	0f 44 d8             	cmove  %eax,%ebx
  800a12:	b8 00 00 00 00       	mov    $0x0,%eax
  800a17:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800a1a:	eb 46                	jmp    800a62 <strtol+0x94>
		s++;
  800a1c:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800a1f:	bf 00 00 00 00       	mov    $0x0,%edi
  800a24:	eb d5                	jmp    8009fb <strtol+0x2d>
		s++, neg = 1;
  800a26:	83 c1 01             	add    $0x1,%ecx
  800a29:	bf 01 00 00 00       	mov    $0x1,%edi
  800a2e:	eb cb                	jmp    8009fb <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a30:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800a34:	74 0e                	je     800a44 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800a36:	85 db                	test   %ebx,%ebx
  800a38:	75 d8                	jne    800a12 <strtol+0x44>
		s++, base = 8;
  800a3a:	83 c1 01             	add    $0x1,%ecx
  800a3d:	bb 08 00 00 00       	mov    $0x8,%ebx
  800a42:	eb ce                	jmp    800a12 <strtol+0x44>
		s += 2, base = 16;
  800a44:	83 c1 02             	add    $0x2,%ecx
  800a47:	bb 10 00 00 00       	mov    $0x10,%ebx
  800a4c:	eb c4                	jmp    800a12 <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800a4e:	0f be d2             	movsbl %dl,%edx
  800a51:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800a54:	3b 55 10             	cmp    0x10(%ebp),%edx
  800a57:	7d 3a                	jge    800a93 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800a59:	83 c1 01             	add    $0x1,%ecx
  800a5c:	0f af 45 10          	imul   0x10(%ebp),%eax
  800a60:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800a62:	0f b6 11             	movzbl (%ecx),%edx
  800a65:	8d 72 d0             	lea    -0x30(%edx),%esi
  800a68:	89 f3                	mov    %esi,%ebx
  800a6a:	80 fb 09             	cmp    $0x9,%bl
  800a6d:	76 df                	jbe    800a4e <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800a6f:	8d 72 9f             	lea    -0x61(%edx),%esi
  800a72:	89 f3                	mov    %esi,%ebx
  800a74:	80 fb 19             	cmp    $0x19,%bl
  800a77:	77 08                	ja     800a81 <strtol+0xb3>
			dig = *s - 'a' + 10;
  800a79:	0f be d2             	movsbl %dl,%edx
  800a7c:	83 ea 57             	sub    $0x57,%edx
  800a7f:	eb d3                	jmp    800a54 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800a81:	8d 72 bf             	lea    -0x41(%edx),%esi
  800a84:	89 f3                	mov    %esi,%ebx
  800a86:	80 fb 19             	cmp    $0x19,%bl
  800a89:	77 08                	ja     800a93 <strtol+0xc5>
			dig = *s - 'A' + 10;
  800a8b:	0f be d2             	movsbl %dl,%edx
  800a8e:	83 ea 37             	sub    $0x37,%edx
  800a91:	eb c1                	jmp    800a54 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800a93:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800a97:	74 05                	je     800a9e <strtol+0xd0>
		*endptr = (char *) s;
  800a99:	8b 75 0c             	mov    0xc(%ebp),%esi
  800a9c:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800a9e:	89 c2                	mov    %eax,%edx
  800aa0:	f7 da                	neg    %edx
  800aa2:	85 ff                	test   %edi,%edi
  800aa4:	0f 45 c2             	cmovne %edx,%eax
}
  800aa7:	5b                   	pop    %ebx
  800aa8:	5e                   	pop    %esi
  800aa9:	5f                   	pop    %edi
  800aaa:	5d                   	pop    %ebp
  800aab:	c3                   	ret    

00800aac <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800aac:	f3 0f 1e fb          	endbr32 
  800ab0:	55                   	push   %ebp
  800ab1:	89 e5                	mov    %esp,%ebp
  800ab3:	57                   	push   %edi
  800ab4:	56                   	push   %esi
  800ab5:	53                   	push   %ebx
	asm volatile("int %1\n"
  800ab6:	b8 00 00 00 00       	mov    $0x0,%eax
  800abb:	8b 55 08             	mov    0x8(%ebp),%edx
  800abe:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ac1:	89 c3                	mov    %eax,%ebx
  800ac3:	89 c7                	mov    %eax,%edi
  800ac5:	89 c6                	mov    %eax,%esi
  800ac7:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800ac9:	5b                   	pop    %ebx
  800aca:	5e                   	pop    %esi
  800acb:	5f                   	pop    %edi
  800acc:	5d                   	pop    %ebp
  800acd:	c3                   	ret    

00800ace <sys_cgetc>:

int
sys_cgetc(void)
{
  800ace:	f3 0f 1e fb          	endbr32 
  800ad2:	55                   	push   %ebp
  800ad3:	89 e5                	mov    %esp,%ebp
  800ad5:	57                   	push   %edi
  800ad6:	56                   	push   %esi
  800ad7:	53                   	push   %ebx
	asm volatile("int %1\n"
  800ad8:	ba 00 00 00 00       	mov    $0x0,%edx
  800add:	b8 01 00 00 00       	mov    $0x1,%eax
  800ae2:	89 d1                	mov    %edx,%ecx
  800ae4:	89 d3                	mov    %edx,%ebx
  800ae6:	89 d7                	mov    %edx,%edi
  800ae8:	89 d6                	mov    %edx,%esi
  800aea:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800aec:	5b                   	pop    %ebx
  800aed:	5e                   	pop    %esi
  800aee:	5f                   	pop    %edi
  800aef:	5d                   	pop    %ebp
  800af0:	c3                   	ret    

00800af1 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800af1:	f3 0f 1e fb          	endbr32 
  800af5:	55                   	push   %ebp
  800af6:	89 e5                	mov    %esp,%ebp
  800af8:	57                   	push   %edi
  800af9:	56                   	push   %esi
  800afa:	53                   	push   %ebx
  800afb:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800afe:	b9 00 00 00 00       	mov    $0x0,%ecx
  800b03:	8b 55 08             	mov    0x8(%ebp),%edx
  800b06:	b8 03 00 00 00       	mov    $0x3,%eax
  800b0b:	89 cb                	mov    %ecx,%ebx
  800b0d:	89 cf                	mov    %ecx,%edi
  800b0f:	89 ce                	mov    %ecx,%esi
  800b11:	cd 30                	int    $0x30
	if(check && ret > 0)
  800b13:	85 c0                	test   %eax,%eax
  800b15:	7f 08                	jg     800b1f <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800b17:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800b1a:	5b                   	pop    %ebx
  800b1b:	5e                   	pop    %esi
  800b1c:	5f                   	pop    %edi
  800b1d:	5d                   	pop    %ebp
  800b1e:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800b1f:	83 ec 0c             	sub    $0xc,%esp
  800b22:	50                   	push   %eax
  800b23:	6a 03                	push   $0x3
  800b25:	68 ff 21 80 00       	push   $0x8021ff
  800b2a:	6a 23                	push   $0x23
  800b2c:	68 1c 22 80 00       	push   $0x80221c
  800b31:	e8 9c 0f 00 00       	call   801ad2 <_panic>

00800b36 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800b36:	f3 0f 1e fb          	endbr32 
  800b3a:	55                   	push   %ebp
  800b3b:	89 e5                	mov    %esp,%ebp
  800b3d:	57                   	push   %edi
  800b3e:	56                   	push   %esi
  800b3f:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b40:	ba 00 00 00 00       	mov    $0x0,%edx
  800b45:	b8 02 00 00 00       	mov    $0x2,%eax
  800b4a:	89 d1                	mov    %edx,%ecx
  800b4c:	89 d3                	mov    %edx,%ebx
  800b4e:	89 d7                	mov    %edx,%edi
  800b50:	89 d6                	mov    %edx,%esi
  800b52:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800b54:	5b                   	pop    %ebx
  800b55:	5e                   	pop    %esi
  800b56:	5f                   	pop    %edi
  800b57:	5d                   	pop    %ebp
  800b58:	c3                   	ret    

00800b59 <sys_yield>:

void
sys_yield(void)
{
  800b59:	f3 0f 1e fb          	endbr32 
  800b5d:	55                   	push   %ebp
  800b5e:	89 e5                	mov    %esp,%ebp
  800b60:	57                   	push   %edi
  800b61:	56                   	push   %esi
  800b62:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b63:	ba 00 00 00 00       	mov    $0x0,%edx
  800b68:	b8 0b 00 00 00       	mov    $0xb,%eax
  800b6d:	89 d1                	mov    %edx,%ecx
  800b6f:	89 d3                	mov    %edx,%ebx
  800b71:	89 d7                	mov    %edx,%edi
  800b73:	89 d6                	mov    %edx,%esi
  800b75:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800b77:	5b                   	pop    %ebx
  800b78:	5e                   	pop    %esi
  800b79:	5f                   	pop    %edi
  800b7a:	5d                   	pop    %ebp
  800b7b:	c3                   	ret    

00800b7c <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800b7c:	f3 0f 1e fb          	endbr32 
  800b80:	55                   	push   %ebp
  800b81:	89 e5                	mov    %esp,%ebp
  800b83:	57                   	push   %edi
  800b84:	56                   	push   %esi
  800b85:	53                   	push   %ebx
  800b86:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800b89:	be 00 00 00 00       	mov    $0x0,%esi
  800b8e:	8b 55 08             	mov    0x8(%ebp),%edx
  800b91:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800b94:	b8 04 00 00 00       	mov    $0x4,%eax
  800b99:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800b9c:	89 f7                	mov    %esi,%edi
  800b9e:	cd 30                	int    $0x30
	if(check && ret > 0)
  800ba0:	85 c0                	test   %eax,%eax
  800ba2:	7f 08                	jg     800bac <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800ba4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800ba7:	5b                   	pop    %ebx
  800ba8:	5e                   	pop    %esi
  800ba9:	5f                   	pop    %edi
  800baa:	5d                   	pop    %ebp
  800bab:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800bac:	83 ec 0c             	sub    $0xc,%esp
  800baf:	50                   	push   %eax
  800bb0:	6a 04                	push   $0x4
  800bb2:	68 ff 21 80 00       	push   $0x8021ff
  800bb7:	6a 23                	push   $0x23
  800bb9:	68 1c 22 80 00       	push   $0x80221c
  800bbe:	e8 0f 0f 00 00       	call   801ad2 <_panic>

00800bc3 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800bc3:	f3 0f 1e fb          	endbr32 
  800bc7:	55                   	push   %ebp
  800bc8:	89 e5                	mov    %esp,%ebp
  800bca:	57                   	push   %edi
  800bcb:	56                   	push   %esi
  800bcc:	53                   	push   %ebx
  800bcd:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800bd0:	8b 55 08             	mov    0x8(%ebp),%edx
  800bd3:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800bd6:	b8 05 00 00 00       	mov    $0x5,%eax
  800bdb:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800bde:	8b 7d 14             	mov    0x14(%ebp),%edi
  800be1:	8b 75 18             	mov    0x18(%ebp),%esi
  800be4:	cd 30                	int    $0x30
	if(check && ret > 0)
  800be6:	85 c0                	test   %eax,%eax
  800be8:	7f 08                	jg     800bf2 <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800bea:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bed:	5b                   	pop    %ebx
  800bee:	5e                   	pop    %esi
  800bef:	5f                   	pop    %edi
  800bf0:	5d                   	pop    %ebp
  800bf1:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800bf2:	83 ec 0c             	sub    $0xc,%esp
  800bf5:	50                   	push   %eax
  800bf6:	6a 05                	push   $0x5
  800bf8:	68 ff 21 80 00       	push   $0x8021ff
  800bfd:	6a 23                	push   $0x23
  800bff:	68 1c 22 80 00       	push   $0x80221c
  800c04:	e8 c9 0e 00 00       	call   801ad2 <_panic>

00800c09 <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800c09:	f3 0f 1e fb          	endbr32 
  800c0d:	55                   	push   %ebp
  800c0e:	89 e5                	mov    %esp,%ebp
  800c10:	57                   	push   %edi
  800c11:	56                   	push   %esi
  800c12:	53                   	push   %ebx
  800c13:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c16:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c1b:	8b 55 08             	mov    0x8(%ebp),%edx
  800c1e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c21:	b8 06 00 00 00       	mov    $0x6,%eax
  800c26:	89 df                	mov    %ebx,%edi
  800c28:	89 de                	mov    %ebx,%esi
  800c2a:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c2c:	85 c0                	test   %eax,%eax
  800c2e:	7f 08                	jg     800c38 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800c30:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c33:	5b                   	pop    %ebx
  800c34:	5e                   	pop    %esi
  800c35:	5f                   	pop    %edi
  800c36:	5d                   	pop    %ebp
  800c37:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c38:	83 ec 0c             	sub    $0xc,%esp
  800c3b:	50                   	push   %eax
  800c3c:	6a 06                	push   $0x6
  800c3e:	68 ff 21 80 00       	push   $0x8021ff
  800c43:	6a 23                	push   $0x23
  800c45:	68 1c 22 80 00       	push   $0x80221c
  800c4a:	e8 83 0e 00 00       	call   801ad2 <_panic>

00800c4f <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800c4f:	f3 0f 1e fb          	endbr32 
  800c53:	55                   	push   %ebp
  800c54:	89 e5                	mov    %esp,%ebp
  800c56:	57                   	push   %edi
  800c57:	56                   	push   %esi
  800c58:	53                   	push   %ebx
  800c59:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c5c:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c61:	8b 55 08             	mov    0x8(%ebp),%edx
  800c64:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c67:	b8 08 00 00 00       	mov    $0x8,%eax
  800c6c:	89 df                	mov    %ebx,%edi
  800c6e:	89 de                	mov    %ebx,%esi
  800c70:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c72:	85 c0                	test   %eax,%eax
  800c74:	7f 08                	jg     800c7e <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800c76:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c79:	5b                   	pop    %ebx
  800c7a:	5e                   	pop    %esi
  800c7b:	5f                   	pop    %edi
  800c7c:	5d                   	pop    %ebp
  800c7d:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c7e:	83 ec 0c             	sub    $0xc,%esp
  800c81:	50                   	push   %eax
  800c82:	6a 08                	push   $0x8
  800c84:	68 ff 21 80 00       	push   $0x8021ff
  800c89:	6a 23                	push   $0x23
  800c8b:	68 1c 22 80 00       	push   $0x80221c
  800c90:	e8 3d 0e 00 00       	call   801ad2 <_panic>

00800c95 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800c95:	f3 0f 1e fb          	endbr32 
  800c99:	55                   	push   %ebp
  800c9a:	89 e5                	mov    %esp,%ebp
  800c9c:	57                   	push   %edi
  800c9d:	56                   	push   %esi
  800c9e:	53                   	push   %ebx
  800c9f:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800ca2:	bb 00 00 00 00       	mov    $0x0,%ebx
  800ca7:	8b 55 08             	mov    0x8(%ebp),%edx
  800caa:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cad:	b8 09 00 00 00       	mov    $0x9,%eax
  800cb2:	89 df                	mov    %ebx,%edi
  800cb4:	89 de                	mov    %ebx,%esi
  800cb6:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cb8:	85 c0                	test   %eax,%eax
  800cba:	7f 08                	jg     800cc4 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800cbc:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800cbf:	5b                   	pop    %ebx
  800cc0:	5e                   	pop    %esi
  800cc1:	5f                   	pop    %edi
  800cc2:	5d                   	pop    %ebp
  800cc3:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800cc4:	83 ec 0c             	sub    $0xc,%esp
  800cc7:	50                   	push   %eax
  800cc8:	6a 09                	push   $0x9
  800cca:	68 ff 21 80 00       	push   $0x8021ff
  800ccf:	6a 23                	push   $0x23
  800cd1:	68 1c 22 80 00       	push   $0x80221c
  800cd6:	e8 f7 0d 00 00       	call   801ad2 <_panic>

00800cdb <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800cdb:	f3 0f 1e fb          	endbr32 
  800cdf:	55                   	push   %ebp
  800ce0:	89 e5                	mov    %esp,%ebp
  800ce2:	57                   	push   %edi
  800ce3:	56                   	push   %esi
  800ce4:	53                   	push   %ebx
  800ce5:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800ce8:	bb 00 00 00 00       	mov    $0x0,%ebx
  800ced:	8b 55 08             	mov    0x8(%ebp),%edx
  800cf0:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cf3:	b8 0a 00 00 00       	mov    $0xa,%eax
  800cf8:	89 df                	mov    %ebx,%edi
  800cfa:	89 de                	mov    %ebx,%esi
  800cfc:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cfe:	85 c0                	test   %eax,%eax
  800d00:	7f 08                	jg     800d0a <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800d02:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d05:	5b                   	pop    %ebx
  800d06:	5e                   	pop    %esi
  800d07:	5f                   	pop    %edi
  800d08:	5d                   	pop    %ebp
  800d09:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d0a:	83 ec 0c             	sub    $0xc,%esp
  800d0d:	50                   	push   %eax
  800d0e:	6a 0a                	push   $0xa
  800d10:	68 ff 21 80 00       	push   $0x8021ff
  800d15:	6a 23                	push   $0x23
  800d17:	68 1c 22 80 00       	push   $0x80221c
  800d1c:	e8 b1 0d 00 00       	call   801ad2 <_panic>

00800d21 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800d21:	f3 0f 1e fb          	endbr32 
  800d25:	55                   	push   %ebp
  800d26:	89 e5                	mov    %esp,%ebp
  800d28:	57                   	push   %edi
  800d29:	56                   	push   %esi
  800d2a:	53                   	push   %ebx
	asm volatile("int %1\n"
  800d2b:	8b 55 08             	mov    0x8(%ebp),%edx
  800d2e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d31:	b8 0c 00 00 00       	mov    $0xc,%eax
  800d36:	be 00 00 00 00       	mov    $0x0,%esi
  800d3b:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800d3e:	8b 7d 14             	mov    0x14(%ebp),%edi
  800d41:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800d43:	5b                   	pop    %ebx
  800d44:	5e                   	pop    %esi
  800d45:	5f                   	pop    %edi
  800d46:	5d                   	pop    %ebp
  800d47:	c3                   	ret    

00800d48 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800d48:	f3 0f 1e fb          	endbr32 
  800d4c:	55                   	push   %ebp
  800d4d:	89 e5                	mov    %esp,%ebp
  800d4f:	57                   	push   %edi
  800d50:	56                   	push   %esi
  800d51:	53                   	push   %ebx
  800d52:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d55:	b9 00 00 00 00       	mov    $0x0,%ecx
  800d5a:	8b 55 08             	mov    0x8(%ebp),%edx
  800d5d:	b8 0d 00 00 00       	mov    $0xd,%eax
  800d62:	89 cb                	mov    %ecx,%ebx
  800d64:	89 cf                	mov    %ecx,%edi
  800d66:	89 ce                	mov    %ecx,%esi
  800d68:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d6a:	85 c0                	test   %eax,%eax
  800d6c:	7f 08                	jg     800d76 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800d6e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d71:	5b                   	pop    %ebx
  800d72:	5e                   	pop    %esi
  800d73:	5f                   	pop    %edi
  800d74:	5d                   	pop    %ebp
  800d75:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d76:	83 ec 0c             	sub    $0xc,%esp
  800d79:	50                   	push   %eax
  800d7a:	6a 0d                	push   $0xd
  800d7c:	68 ff 21 80 00       	push   $0x8021ff
  800d81:	6a 23                	push   $0x23
  800d83:	68 1c 22 80 00       	push   $0x80221c
  800d88:	e8 45 0d 00 00       	call   801ad2 <_panic>

00800d8d <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800d8d:	f3 0f 1e fb          	endbr32 
  800d91:	55                   	push   %ebp
  800d92:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800d94:	8b 45 08             	mov    0x8(%ebp),%eax
  800d97:	05 00 00 00 30       	add    $0x30000000,%eax
  800d9c:	c1 e8 0c             	shr    $0xc,%eax
}
  800d9f:	5d                   	pop    %ebp
  800da0:	c3                   	ret    

00800da1 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800da1:	f3 0f 1e fb          	endbr32 
  800da5:	55                   	push   %ebp
  800da6:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800da8:	8b 45 08             	mov    0x8(%ebp),%eax
  800dab:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800db0:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800db5:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800dba:	5d                   	pop    %ebp
  800dbb:	c3                   	ret    

00800dbc <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800dbc:	f3 0f 1e fb          	endbr32 
  800dc0:	55                   	push   %ebp
  800dc1:	89 e5                	mov    %esp,%ebp
  800dc3:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800dc8:	89 c2                	mov    %eax,%edx
  800dca:	c1 ea 16             	shr    $0x16,%edx
  800dcd:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800dd4:	f6 c2 01             	test   $0x1,%dl
  800dd7:	74 2d                	je     800e06 <fd_alloc+0x4a>
  800dd9:	89 c2                	mov    %eax,%edx
  800ddb:	c1 ea 0c             	shr    $0xc,%edx
  800dde:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800de5:	f6 c2 01             	test   $0x1,%dl
  800de8:	74 1c                	je     800e06 <fd_alloc+0x4a>
  800dea:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800def:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800df4:	75 d2                	jne    800dc8 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800df6:	8b 45 08             	mov    0x8(%ebp),%eax
  800df9:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800dff:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800e04:	eb 0a                	jmp    800e10 <fd_alloc+0x54>
			*fd_store = fd;
  800e06:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800e09:	89 01                	mov    %eax,(%ecx)
			return 0;
  800e0b:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e10:	5d                   	pop    %ebp
  800e11:	c3                   	ret    

00800e12 <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800e12:	f3 0f 1e fb          	endbr32 
  800e16:	55                   	push   %ebp
  800e17:	89 e5                	mov    %esp,%ebp
  800e19:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800e1c:	83 f8 1f             	cmp    $0x1f,%eax
  800e1f:	77 30                	ja     800e51 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800e21:	c1 e0 0c             	shl    $0xc,%eax
  800e24:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800e29:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800e2f:	f6 c2 01             	test   $0x1,%dl
  800e32:	74 24                	je     800e58 <fd_lookup+0x46>
  800e34:	89 c2                	mov    %eax,%edx
  800e36:	c1 ea 0c             	shr    $0xc,%edx
  800e39:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800e40:	f6 c2 01             	test   $0x1,%dl
  800e43:	74 1a                	je     800e5f <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800e45:	8b 55 0c             	mov    0xc(%ebp),%edx
  800e48:	89 02                	mov    %eax,(%edx)
	return 0;
  800e4a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e4f:	5d                   	pop    %ebp
  800e50:	c3                   	ret    
		return -E_INVAL;
  800e51:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e56:	eb f7                	jmp    800e4f <fd_lookup+0x3d>
		return -E_INVAL;
  800e58:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e5d:	eb f0                	jmp    800e4f <fd_lookup+0x3d>
  800e5f:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e64:	eb e9                	jmp    800e4f <fd_lookup+0x3d>

00800e66 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800e66:	f3 0f 1e fb          	endbr32 
  800e6a:	55                   	push   %ebp
  800e6b:	89 e5                	mov    %esp,%ebp
  800e6d:	83 ec 08             	sub    $0x8,%esp
  800e70:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800e73:	ba a8 22 80 00       	mov    $0x8022a8,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800e78:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800e7d:	39 08                	cmp    %ecx,(%eax)
  800e7f:	74 33                	je     800eb4 <dev_lookup+0x4e>
  800e81:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800e84:	8b 02                	mov    (%edx),%eax
  800e86:	85 c0                	test   %eax,%eax
  800e88:	75 f3                	jne    800e7d <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800e8a:	a1 04 40 80 00       	mov    0x804004,%eax
  800e8f:	8b 40 48             	mov    0x48(%eax),%eax
  800e92:	83 ec 04             	sub    $0x4,%esp
  800e95:	51                   	push   %ecx
  800e96:	50                   	push   %eax
  800e97:	68 2c 22 80 00       	push   $0x80222c
  800e9c:	e8 c0 f2 ff ff       	call   800161 <cprintf>
	*dev = 0;
  800ea1:	8b 45 0c             	mov    0xc(%ebp),%eax
  800ea4:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  800eaa:	83 c4 10             	add    $0x10,%esp
  800ead:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  800eb2:	c9                   	leave  
  800eb3:	c3                   	ret    
			*dev = devtab[i];
  800eb4:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800eb7:	89 01                	mov    %eax,(%ecx)
			return 0;
  800eb9:	b8 00 00 00 00       	mov    $0x0,%eax
  800ebe:	eb f2                	jmp    800eb2 <dev_lookup+0x4c>

00800ec0 <fd_close>:
{
  800ec0:	f3 0f 1e fb          	endbr32 
  800ec4:	55                   	push   %ebp
  800ec5:	89 e5                	mov    %esp,%ebp
  800ec7:	57                   	push   %edi
  800ec8:	56                   	push   %esi
  800ec9:	53                   	push   %ebx
  800eca:	83 ec 24             	sub    $0x24,%esp
  800ecd:	8b 75 08             	mov    0x8(%ebp),%esi
  800ed0:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800ed3:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800ed6:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800ed7:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  800edd:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800ee0:	50                   	push   %eax
  800ee1:	e8 2c ff ff ff       	call   800e12 <fd_lookup>
  800ee6:	89 c3                	mov    %eax,%ebx
  800ee8:	83 c4 10             	add    $0x10,%esp
  800eeb:	85 c0                	test   %eax,%eax
  800eed:	78 05                	js     800ef4 <fd_close+0x34>
	    || fd != fd2)
  800eef:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  800ef2:	74 16                	je     800f0a <fd_close+0x4a>
		return (must_exist ? r : 0);
  800ef4:	89 f8                	mov    %edi,%eax
  800ef6:	84 c0                	test   %al,%al
  800ef8:	b8 00 00 00 00       	mov    $0x0,%eax
  800efd:	0f 44 d8             	cmove  %eax,%ebx
}
  800f00:	89 d8                	mov    %ebx,%eax
  800f02:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800f05:	5b                   	pop    %ebx
  800f06:	5e                   	pop    %esi
  800f07:	5f                   	pop    %edi
  800f08:	5d                   	pop    %ebp
  800f09:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  800f0a:	83 ec 08             	sub    $0x8,%esp
  800f0d:	8d 45 e0             	lea    -0x20(%ebp),%eax
  800f10:	50                   	push   %eax
  800f11:	ff 36                	pushl  (%esi)
  800f13:	e8 4e ff ff ff       	call   800e66 <dev_lookup>
  800f18:	89 c3                	mov    %eax,%ebx
  800f1a:	83 c4 10             	add    $0x10,%esp
  800f1d:	85 c0                	test   %eax,%eax
  800f1f:	78 1a                	js     800f3b <fd_close+0x7b>
		if (dev->dev_close)
  800f21:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800f24:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  800f27:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  800f2c:	85 c0                	test   %eax,%eax
  800f2e:	74 0b                	je     800f3b <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  800f30:	83 ec 0c             	sub    $0xc,%esp
  800f33:	56                   	push   %esi
  800f34:	ff d0                	call   *%eax
  800f36:	89 c3                	mov    %eax,%ebx
  800f38:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  800f3b:	83 ec 08             	sub    $0x8,%esp
  800f3e:	56                   	push   %esi
  800f3f:	6a 00                	push   $0x0
  800f41:	e8 c3 fc ff ff       	call   800c09 <sys_page_unmap>
	return r;
  800f46:	83 c4 10             	add    $0x10,%esp
  800f49:	eb b5                	jmp    800f00 <fd_close+0x40>

00800f4b <close>:

int
close(int fdnum)
{
  800f4b:	f3 0f 1e fb          	endbr32 
  800f4f:	55                   	push   %ebp
  800f50:	89 e5                	mov    %esp,%ebp
  800f52:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  800f55:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800f58:	50                   	push   %eax
  800f59:	ff 75 08             	pushl  0x8(%ebp)
  800f5c:	e8 b1 fe ff ff       	call   800e12 <fd_lookup>
  800f61:	83 c4 10             	add    $0x10,%esp
  800f64:	85 c0                	test   %eax,%eax
  800f66:	79 02                	jns    800f6a <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  800f68:	c9                   	leave  
  800f69:	c3                   	ret    
		return fd_close(fd, 1);
  800f6a:	83 ec 08             	sub    $0x8,%esp
  800f6d:	6a 01                	push   $0x1
  800f6f:	ff 75 f4             	pushl  -0xc(%ebp)
  800f72:	e8 49 ff ff ff       	call   800ec0 <fd_close>
  800f77:	83 c4 10             	add    $0x10,%esp
  800f7a:	eb ec                	jmp    800f68 <close+0x1d>

00800f7c <close_all>:

void
close_all(void)
{
  800f7c:	f3 0f 1e fb          	endbr32 
  800f80:	55                   	push   %ebp
  800f81:	89 e5                	mov    %esp,%ebp
  800f83:	53                   	push   %ebx
  800f84:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  800f87:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  800f8c:	83 ec 0c             	sub    $0xc,%esp
  800f8f:	53                   	push   %ebx
  800f90:	e8 b6 ff ff ff       	call   800f4b <close>
	for (i = 0; i < MAXFD; i++)
  800f95:	83 c3 01             	add    $0x1,%ebx
  800f98:	83 c4 10             	add    $0x10,%esp
  800f9b:	83 fb 20             	cmp    $0x20,%ebx
  800f9e:	75 ec                	jne    800f8c <close_all+0x10>
}
  800fa0:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800fa3:	c9                   	leave  
  800fa4:	c3                   	ret    

00800fa5 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  800fa5:	f3 0f 1e fb          	endbr32 
  800fa9:	55                   	push   %ebp
  800faa:	89 e5                	mov    %esp,%ebp
  800fac:	57                   	push   %edi
  800fad:	56                   	push   %esi
  800fae:	53                   	push   %ebx
  800faf:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  800fb2:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800fb5:	50                   	push   %eax
  800fb6:	ff 75 08             	pushl  0x8(%ebp)
  800fb9:	e8 54 fe ff ff       	call   800e12 <fd_lookup>
  800fbe:	89 c3                	mov    %eax,%ebx
  800fc0:	83 c4 10             	add    $0x10,%esp
  800fc3:	85 c0                	test   %eax,%eax
  800fc5:	0f 88 81 00 00 00    	js     80104c <dup+0xa7>
		return r;
	close(newfdnum);
  800fcb:	83 ec 0c             	sub    $0xc,%esp
  800fce:	ff 75 0c             	pushl  0xc(%ebp)
  800fd1:	e8 75 ff ff ff       	call   800f4b <close>

	newfd = INDEX2FD(newfdnum);
  800fd6:	8b 75 0c             	mov    0xc(%ebp),%esi
  800fd9:	c1 e6 0c             	shl    $0xc,%esi
  800fdc:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  800fe2:	83 c4 04             	add    $0x4,%esp
  800fe5:	ff 75 e4             	pushl  -0x1c(%ebp)
  800fe8:	e8 b4 fd ff ff       	call   800da1 <fd2data>
  800fed:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  800fef:	89 34 24             	mov    %esi,(%esp)
  800ff2:	e8 aa fd ff ff       	call   800da1 <fd2data>
  800ff7:	83 c4 10             	add    $0x10,%esp
  800ffa:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  800ffc:	89 d8                	mov    %ebx,%eax
  800ffe:	c1 e8 16             	shr    $0x16,%eax
  801001:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801008:	a8 01                	test   $0x1,%al
  80100a:	74 11                	je     80101d <dup+0x78>
  80100c:	89 d8                	mov    %ebx,%eax
  80100e:	c1 e8 0c             	shr    $0xc,%eax
  801011:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801018:	f6 c2 01             	test   $0x1,%dl
  80101b:	75 39                	jne    801056 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  80101d:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  801020:	89 d0                	mov    %edx,%eax
  801022:	c1 e8 0c             	shr    $0xc,%eax
  801025:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80102c:	83 ec 0c             	sub    $0xc,%esp
  80102f:	25 07 0e 00 00       	and    $0xe07,%eax
  801034:	50                   	push   %eax
  801035:	56                   	push   %esi
  801036:	6a 00                	push   $0x0
  801038:	52                   	push   %edx
  801039:	6a 00                	push   $0x0
  80103b:	e8 83 fb ff ff       	call   800bc3 <sys_page_map>
  801040:	89 c3                	mov    %eax,%ebx
  801042:	83 c4 20             	add    $0x20,%esp
  801045:	85 c0                	test   %eax,%eax
  801047:	78 31                	js     80107a <dup+0xd5>
		goto err;

	return newfdnum;
  801049:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  80104c:	89 d8                	mov    %ebx,%eax
  80104e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801051:	5b                   	pop    %ebx
  801052:	5e                   	pop    %esi
  801053:	5f                   	pop    %edi
  801054:	5d                   	pop    %ebp
  801055:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  801056:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80105d:	83 ec 0c             	sub    $0xc,%esp
  801060:	25 07 0e 00 00       	and    $0xe07,%eax
  801065:	50                   	push   %eax
  801066:	57                   	push   %edi
  801067:	6a 00                	push   $0x0
  801069:	53                   	push   %ebx
  80106a:	6a 00                	push   $0x0
  80106c:	e8 52 fb ff ff       	call   800bc3 <sys_page_map>
  801071:	89 c3                	mov    %eax,%ebx
  801073:	83 c4 20             	add    $0x20,%esp
  801076:	85 c0                	test   %eax,%eax
  801078:	79 a3                	jns    80101d <dup+0x78>
	sys_page_unmap(0, newfd);
  80107a:	83 ec 08             	sub    $0x8,%esp
  80107d:	56                   	push   %esi
  80107e:	6a 00                	push   $0x0
  801080:	e8 84 fb ff ff       	call   800c09 <sys_page_unmap>
	sys_page_unmap(0, nva);
  801085:	83 c4 08             	add    $0x8,%esp
  801088:	57                   	push   %edi
  801089:	6a 00                	push   $0x0
  80108b:	e8 79 fb ff ff       	call   800c09 <sys_page_unmap>
	return r;
  801090:	83 c4 10             	add    $0x10,%esp
  801093:	eb b7                	jmp    80104c <dup+0xa7>

00801095 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  801095:	f3 0f 1e fb          	endbr32 
  801099:	55                   	push   %ebp
  80109a:	89 e5                	mov    %esp,%ebp
  80109c:	53                   	push   %ebx
  80109d:	83 ec 1c             	sub    $0x1c,%esp
  8010a0:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8010a3:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8010a6:	50                   	push   %eax
  8010a7:	53                   	push   %ebx
  8010a8:	e8 65 fd ff ff       	call   800e12 <fd_lookup>
  8010ad:	83 c4 10             	add    $0x10,%esp
  8010b0:	85 c0                	test   %eax,%eax
  8010b2:	78 3f                	js     8010f3 <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8010b4:	83 ec 08             	sub    $0x8,%esp
  8010b7:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8010ba:	50                   	push   %eax
  8010bb:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8010be:	ff 30                	pushl  (%eax)
  8010c0:	e8 a1 fd ff ff       	call   800e66 <dev_lookup>
  8010c5:	83 c4 10             	add    $0x10,%esp
  8010c8:	85 c0                	test   %eax,%eax
  8010ca:	78 27                	js     8010f3 <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  8010cc:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8010cf:	8b 42 08             	mov    0x8(%edx),%eax
  8010d2:	83 e0 03             	and    $0x3,%eax
  8010d5:	83 f8 01             	cmp    $0x1,%eax
  8010d8:	74 1e                	je     8010f8 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  8010da:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8010dd:	8b 40 08             	mov    0x8(%eax),%eax
  8010e0:	85 c0                	test   %eax,%eax
  8010e2:	74 35                	je     801119 <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  8010e4:	83 ec 04             	sub    $0x4,%esp
  8010e7:	ff 75 10             	pushl  0x10(%ebp)
  8010ea:	ff 75 0c             	pushl  0xc(%ebp)
  8010ed:	52                   	push   %edx
  8010ee:	ff d0                	call   *%eax
  8010f0:	83 c4 10             	add    $0x10,%esp
}
  8010f3:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8010f6:	c9                   	leave  
  8010f7:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  8010f8:	a1 04 40 80 00       	mov    0x804004,%eax
  8010fd:	8b 40 48             	mov    0x48(%eax),%eax
  801100:	83 ec 04             	sub    $0x4,%esp
  801103:	53                   	push   %ebx
  801104:	50                   	push   %eax
  801105:	68 6d 22 80 00       	push   $0x80226d
  80110a:	e8 52 f0 ff ff       	call   800161 <cprintf>
		return -E_INVAL;
  80110f:	83 c4 10             	add    $0x10,%esp
  801112:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801117:	eb da                	jmp    8010f3 <read+0x5e>
		return -E_NOT_SUPP;
  801119:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80111e:	eb d3                	jmp    8010f3 <read+0x5e>

00801120 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  801120:	f3 0f 1e fb          	endbr32 
  801124:	55                   	push   %ebp
  801125:	89 e5                	mov    %esp,%ebp
  801127:	57                   	push   %edi
  801128:	56                   	push   %esi
  801129:	53                   	push   %ebx
  80112a:	83 ec 0c             	sub    $0xc,%esp
  80112d:	8b 7d 08             	mov    0x8(%ebp),%edi
  801130:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  801133:	bb 00 00 00 00       	mov    $0x0,%ebx
  801138:	eb 02                	jmp    80113c <readn+0x1c>
  80113a:	01 c3                	add    %eax,%ebx
  80113c:	39 f3                	cmp    %esi,%ebx
  80113e:	73 21                	jae    801161 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801140:	83 ec 04             	sub    $0x4,%esp
  801143:	89 f0                	mov    %esi,%eax
  801145:	29 d8                	sub    %ebx,%eax
  801147:	50                   	push   %eax
  801148:	89 d8                	mov    %ebx,%eax
  80114a:	03 45 0c             	add    0xc(%ebp),%eax
  80114d:	50                   	push   %eax
  80114e:	57                   	push   %edi
  80114f:	e8 41 ff ff ff       	call   801095 <read>
		if (m < 0)
  801154:	83 c4 10             	add    $0x10,%esp
  801157:	85 c0                	test   %eax,%eax
  801159:	78 04                	js     80115f <readn+0x3f>
			return m;
		if (m == 0)
  80115b:	75 dd                	jne    80113a <readn+0x1a>
  80115d:	eb 02                	jmp    801161 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  80115f:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  801161:	89 d8                	mov    %ebx,%eax
  801163:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801166:	5b                   	pop    %ebx
  801167:	5e                   	pop    %esi
  801168:	5f                   	pop    %edi
  801169:	5d                   	pop    %ebp
  80116a:	c3                   	ret    

0080116b <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  80116b:	f3 0f 1e fb          	endbr32 
  80116f:	55                   	push   %ebp
  801170:	89 e5                	mov    %esp,%ebp
  801172:	53                   	push   %ebx
  801173:	83 ec 1c             	sub    $0x1c,%esp
  801176:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  801179:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80117c:	50                   	push   %eax
  80117d:	53                   	push   %ebx
  80117e:	e8 8f fc ff ff       	call   800e12 <fd_lookup>
  801183:	83 c4 10             	add    $0x10,%esp
  801186:	85 c0                	test   %eax,%eax
  801188:	78 3a                	js     8011c4 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80118a:	83 ec 08             	sub    $0x8,%esp
  80118d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801190:	50                   	push   %eax
  801191:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801194:	ff 30                	pushl  (%eax)
  801196:	e8 cb fc ff ff       	call   800e66 <dev_lookup>
  80119b:	83 c4 10             	add    $0x10,%esp
  80119e:	85 c0                	test   %eax,%eax
  8011a0:	78 22                	js     8011c4 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8011a2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011a5:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8011a9:	74 1e                	je     8011c9 <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  8011ab:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8011ae:	8b 52 0c             	mov    0xc(%edx),%edx
  8011b1:	85 d2                	test   %edx,%edx
  8011b3:	74 35                	je     8011ea <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  8011b5:	83 ec 04             	sub    $0x4,%esp
  8011b8:	ff 75 10             	pushl  0x10(%ebp)
  8011bb:	ff 75 0c             	pushl  0xc(%ebp)
  8011be:	50                   	push   %eax
  8011bf:	ff d2                	call   *%edx
  8011c1:	83 c4 10             	add    $0x10,%esp
}
  8011c4:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8011c7:	c9                   	leave  
  8011c8:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  8011c9:	a1 04 40 80 00       	mov    0x804004,%eax
  8011ce:	8b 40 48             	mov    0x48(%eax),%eax
  8011d1:	83 ec 04             	sub    $0x4,%esp
  8011d4:	53                   	push   %ebx
  8011d5:	50                   	push   %eax
  8011d6:	68 89 22 80 00       	push   $0x802289
  8011db:	e8 81 ef ff ff       	call   800161 <cprintf>
		return -E_INVAL;
  8011e0:	83 c4 10             	add    $0x10,%esp
  8011e3:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8011e8:	eb da                	jmp    8011c4 <write+0x59>
		return -E_NOT_SUPP;
  8011ea:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8011ef:	eb d3                	jmp    8011c4 <write+0x59>

008011f1 <seek>:

int
seek(int fdnum, off_t offset)
{
  8011f1:	f3 0f 1e fb          	endbr32 
  8011f5:	55                   	push   %ebp
  8011f6:	89 e5                	mov    %esp,%ebp
  8011f8:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  8011fb:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8011fe:	50                   	push   %eax
  8011ff:	ff 75 08             	pushl  0x8(%ebp)
  801202:	e8 0b fc ff ff       	call   800e12 <fd_lookup>
  801207:	83 c4 10             	add    $0x10,%esp
  80120a:	85 c0                	test   %eax,%eax
  80120c:	78 0e                	js     80121c <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  80120e:	8b 55 0c             	mov    0xc(%ebp),%edx
  801211:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801214:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801217:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80121c:	c9                   	leave  
  80121d:	c3                   	ret    

0080121e <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  80121e:	f3 0f 1e fb          	endbr32 
  801222:	55                   	push   %ebp
  801223:	89 e5                	mov    %esp,%ebp
  801225:	53                   	push   %ebx
  801226:	83 ec 1c             	sub    $0x1c,%esp
  801229:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  80122c:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80122f:	50                   	push   %eax
  801230:	53                   	push   %ebx
  801231:	e8 dc fb ff ff       	call   800e12 <fd_lookup>
  801236:	83 c4 10             	add    $0x10,%esp
  801239:	85 c0                	test   %eax,%eax
  80123b:	78 37                	js     801274 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80123d:	83 ec 08             	sub    $0x8,%esp
  801240:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801243:	50                   	push   %eax
  801244:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801247:	ff 30                	pushl  (%eax)
  801249:	e8 18 fc ff ff       	call   800e66 <dev_lookup>
  80124e:	83 c4 10             	add    $0x10,%esp
  801251:	85 c0                	test   %eax,%eax
  801253:	78 1f                	js     801274 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  801255:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801258:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  80125c:	74 1b                	je     801279 <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  80125e:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801261:	8b 52 18             	mov    0x18(%edx),%edx
  801264:	85 d2                	test   %edx,%edx
  801266:	74 32                	je     80129a <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  801268:	83 ec 08             	sub    $0x8,%esp
  80126b:	ff 75 0c             	pushl  0xc(%ebp)
  80126e:	50                   	push   %eax
  80126f:	ff d2                	call   *%edx
  801271:	83 c4 10             	add    $0x10,%esp
}
  801274:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801277:	c9                   	leave  
  801278:	c3                   	ret    
			thisenv->env_id, fdnum);
  801279:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  80127e:	8b 40 48             	mov    0x48(%eax),%eax
  801281:	83 ec 04             	sub    $0x4,%esp
  801284:	53                   	push   %ebx
  801285:	50                   	push   %eax
  801286:	68 4c 22 80 00       	push   $0x80224c
  80128b:	e8 d1 ee ff ff       	call   800161 <cprintf>
		return -E_INVAL;
  801290:	83 c4 10             	add    $0x10,%esp
  801293:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801298:	eb da                	jmp    801274 <ftruncate+0x56>
		return -E_NOT_SUPP;
  80129a:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80129f:	eb d3                	jmp    801274 <ftruncate+0x56>

008012a1 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  8012a1:	f3 0f 1e fb          	endbr32 
  8012a5:	55                   	push   %ebp
  8012a6:	89 e5                	mov    %esp,%ebp
  8012a8:	53                   	push   %ebx
  8012a9:	83 ec 1c             	sub    $0x1c,%esp
  8012ac:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8012af:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8012b2:	50                   	push   %eax
  8012b3:	ff 75 08             	pushl  0x8(%ebp)
  8012b6:	e8 57 fb ff ff       	call   800e12 <fd_lookup>
  8012bb:	83 c4 10             	add    $0x10,%esp
  8012be:	85 c0                	test   %eax,%eax
  8012c0:	78 4b                	js     80130d <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8012c2:	83 ec 08             	sub    $0x8,%esp
  8012c5:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8012c8:	50                   	push   %eax
  8012c9:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012cc:	ff 30                	pushl  (%eax)
  8012ce:	e8 93 fb ff ff       	call   800e66 <dev_lookup>
  8012d3:	83 c4 10             	add    $0x10,%esp
  8012d6:	85 c0                	test   %eax,%eax
  8012d8:	78 33                	js     80130d <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  8012da:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8012dd:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  8012e1:	74 2f                	je     801312 <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  8012e3:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  8012e6:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  8012ed:	00 00 00 
	stat->st_isdir = 0;
  8012f0:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  8012f7:	00 00 00 
	stat->st_dev = dev;
  8012fa:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  801300:	83 ec 08             	sub    $0x8,%esp
  801303:	53                   	push   %ebx
  801304:	ff 75 f0             	pushl  -0x10(%ebp)
  801307:	ff 50 14             	call   *0x14(%eax)
  80130a:	83 c4 10             	add    $0x10,%esp
}
  80130d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801310:	c9                   	leave  
  801311:	c3                   	ret    
		return -E_NOT_SUPP;
  801312:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801317:	eb f4                	jmp    80130d <fstat+0x6c>

00801319 <stat>:

int
stat(const char *path, struct Stat *stat)
{
  801319:	f3 0f 1e fb          	endbr32 
  80131d:	55                   	push   %ebp
  80131e:	89 e5                	mov    %esp,%ebp
  801320:	56                   	push   %esi
  801321:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  801322:	83 ec 08             	sub    $0x8,%esp
  801325:	6a 00                	push   $0x0
  801327:	ff 75 08             	pushl  0x8(%ebp)
  80132a:	e8 fb 01 00 00       	call   80152a <open>
  80132f:	89 c3                	mov    %eax,%ebx
  801331:	83 c4 10             	add    $0x10,%esp
  801334:	85 c0                	test   %eax,%eax
  801336:	78 1b                	js     801353 <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  801338:	83 ec 08             	sub    $0x8,%esp
  80133b:	ff 75 0c             	pushl  0xc(%ebp)
  80133e:	50                   	push   %eax
  80133f:	e8 5d ff ff ff       	call   8012a1 <fstat>
  801344:	89 c6                	mov    %eax,%esi
	close(fd);
  801346:	89 1c 24             	mov    %ebx,(%esp)
  801349:	e8 fd fb ff ff       	call   800f4b <close>
	return r;
  80134e:	83 c4 10             	add    $0x10,%esp
  801351:	89 f3                	mov    %esi,%ebx
}
  801353:	89 d8                	mov    %ebx,%eax
  801355:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801358:	5b                   	pop    %ebx
  801359:	5e                   	pop    %esi
  80135a:	5d                   	pop    %ebp
  80135b:	c3                   	ret    

0080135c <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  80135c:	55                   	push   %ebp
  80135d:	89 e5                	mov    %esp,%ebp
  80135f:	56                   	push   %esi
  801360:	53                   	push   %ebx
  801361:	89 c6                	mov    %eax,%esi
  801363:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  801365:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  80136c:	74 27                	je     801395 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  80136e:	6a 07                	push   $0x7
  801370:	68 00 50 80 00       	push   $0x805000
  801375:	56                   	push   %esi
  801376:	ff 35 00 40 80 00    	pushl  0x804000
  80137c:	e8 1c 08 00 00       	call   801b9d <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  801381:	83 c4 0c             	add    $0xc,%esp
  801384:	6a 00                	push   $0x0
  801386:	53                   	push   %ebx
  801387:	6a 00                	push   $0x0
  801389:	e8 8e 07 00 00       	call   801b1c <ipc_recv>
}
  80138e:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801391:	5b                   	pop    %ebx
  801392:	5e                   	pop    %esi
  801393:	5d                   	pop    %ebp
  801394:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  801395:	83 ec 0c             	sub    $0xc,%esp
  801398:	6a 01                	push   $0x1
  80139a:	e8 56 08 00 00       	call   801bf5 <ipc_find_env>
  80139f:	a3 00 40 80 00       	mov    %eax,0x804000
  8013a4:	83 c4 10             	add    $0x10,%esp
  8013a7:	eb c5                	jmp    80136e <fsipc+0x12>

008013a9 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  8013a9:	f3 0f 1e fb          	endbr32 
  8013ad:	55                   	push   %ebp
  8013ae:	89 e5                	mov    %esp,%ebp
  8013b0:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  8013b3:	8b 45 08             	mov    0x8(%ebp),%eax
  8013b6:	8b 40 0c             	mov    0xc(%eax),%eax
  8013b9:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  8013be:	8b 45 0c             	mov    0xc(%ebp),%eax
  8013c1:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  8013c6:	ba 00 00 00 00       	mov    $0x0,%edx
  8013cb:	b8 02 00 00 00       	mov    $0x2,%eax
  8013d0:	e8 87 ff ff ff       	call   80135c <fsipc>
}
  8013d5:	c9                   	leave  
  8013d6:	c3                   	ret    

008013d7 <devfile_flush>:
{
  8013d7:	f3 0f 1e fb          	endbr32 
  8013db:	55                   	push   %ebp
  8013dc:	89 e5                	mov    %esp,%ebp
  8013de:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  8013e1:	8b 45 08             	mov    0x8(%ebp),%eax
  8013e4:	8b 40 0c             	mov    0xc(%eax),%eax
  8013e7:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  8013ec:	ba 00 00 00 00       	mov    $0x0,%edx
  8013f1:	b8 06 00 00 00       	mov    $0x6,%eax
  8013f6:	e8 61 ff ff ff       	call   80135c <fsipc>
}
  8013fb:	c9                   	leave  
  8013fc:	c3                   	ret    

008013fd <devfile_stat>:
{
  8013fd:	f3 0f 1e fb          	endbr32 
  801401:	55                   	push   %ebp
  801402:	89 e5                	mov    %esp,%ebp
  801404:	53                   	push   %ebx
  801405:	83 ec 04             	sub    $0x4,%esp
  801408:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  80140b:	8b 45 08             	mov    0x8(%ebp),%eax
  80140e:	8b 40 0c             	mov    0xc(%eax),%eax
  801411:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  801416:	ba 00 00 00 00       	mov    $0x0,%edx
  80141b:	b8 05 00 00 00       	mov    $0x5,%eax
  801420:	e8 37 ff ff ff       	call   80135c <fsipc>
  801425:	85 c0                	test   %eax,%eax
  801427:	78 2c                	js     801455 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  801429:	83 ec 08             	sub    $0x8,%esp
  80142c:	68 00 50 80 00       	push   $0x805000
  801431:	53                   	push   %ebx
  801432:	e8 03 f3 ff ff       	call   80073a <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  801437:	a1 80 50 80 00       	mov    0x805080,%eax
  80143c:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  801442:	a1 84 50 80 00       	mov    0x805084,%eax
  801447:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  80144d:	83 c4 10             	add    $0x10,%esp
  801450:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801455:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801458:	c9                   	leave  
  801459:	c3                   	ret    

0080145a <devfile_write>:
{
  80145a:	f3 0f 1e fb          	endbr32 
  80145e:	55                   	push   %ebp
  80145f:	89 e5                	mov    %esp,%ebp
  801461:	83 ec 0c             	sub    $0xc,%esp
  801464:	8b 45 10             	mov    0x10(%ebp),%eax
  801467:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  80146c:	ba f8 0f 00 00       	mov    $0xff8,%edx
  801471:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  801474:	8b 55 08             	mov    0x8(%ebp),%edx
  801477:	8b 52 0c             	mov    0xc(%edx),%edx
  80147a:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  801480:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  801485:	50                   	push   %eax
  801486:	ff 75 0c             	pushl  0xc(%ebp)
  801489:	68 08 50 80 00       	push   $0x805008
  80148e:	e8 5d f4 ff ff       	call   8008f0 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  801493:	ba 00 00 00 00       	mov    $0x0,%edx
  801498:	b8 04 00 00 00       	mov    $0x4,%eax
  80149d:	e8 ba fe ff ff       	call   80135c <fsipc>
  8014a2:	c9                   	leave  
  8014a3:	c3                   	ret    

008014a4 <devfile_read>:
{
  8014a4:	f3 0f 1e fb          	endbr32 
  8014a8:	55                   	push   %ebp
  8014a9:	89 e5                	mov    %esp,%ebp
  8014ab:	56                   	push   %esi
  8014ac:	53                   	push   %ebx
  8014ad:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  8014b0:	8b 45 08             	mov    0x8(%ebp),%eax
  8014b3:	8b 40 0c             	mov    0xc(%eax),%eax
  8014b6:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  8014bb:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  8014c1:	ba 00 00 00 00       	mov    $0x0,%edx
  8014c6:	b8 03 00 00 00       	mov    $0x3,%eax
  8014cb:	e8 8c fe ff ff       	call   80135c <fsipc>
  8014d0:	89 c3                	mov    %eax,%ebx
  8014d2:	85 c0                	test   %eax,%eax
  8014d4:	78 1f                	js     8014f5 <devfile_read+0x51>
	assert(r <= n);
  8014d6:	39 f0                	cmp    %esi,%eax
  8014d8:	77 24                	ja     8014fe <devfile_read+0x5a>
	assert(r <= PGSIZE);
  8014da:	3d 00 10 00 00       	cmp    $0x1000,%eax
  8014df:	7f 33                	jg     801514 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  8014e1:	83 ec 04             	sub    $0x4,%esp
  8014e4:	50                   	push   %eax
  8014e5:	68 00 50 80 00       	push   $0x805000
  8014ea:	ff 75 0c             	pushl  0xc(%ebp)
  8014ed:	e8 fe f3 ff ff       	call   8008f0 <memmove>
	return r;
  8014f2:	83 c4 10             	add    $0x10,%esp
}
  8014f5:	89 d8                	mov    %ebx,%eax
  8014f7:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8014fa:	5b                   	pop    %ebx
  8014fb:	5e                   	pop    %esi
  8014fc:	5d                   	pop    %ebp
  8014fd:	c3                   	ret    
	assert(r <= n);
  8014fe:	68 b8 22 80 00       	push   $0x8022b8
  801503:	68 bf 22 80 00       	push   $0x8022bf
  801508:	6a 7c                	push   $0x7c
  80150a:	68 d4 22 80 00       	push   $0x8022d4
  80150f:	e8 be 05 00 00       	call   801ad2 <_panic>
	assert(r <= PGSIZE);
  801514:	68 df 22 80 00       	push   $0x8022df
  801519:	68 bf 22 80 00       	push   $0x8022bf
  80151e:	6a 7d                	push   $0x7d
  801520:	68 d4 22 80 00       	push   $0x8022d4
  801525:	e8 a8 05 00 00       	call   801ad2 <_panic>

0080152a <open>:
{
  80152a:	f3 0f 1e fb          	endbr32 
  80152e:	55                   	push   %ebp
  80152f:	89 e5                	mov    %esp,%ebp
  801531:	56                   	push   %esi
  801532:	53                   	push   %ebx
  801533:	83 ec 1c             	sub    $0x1c,%esp
  801536:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  801539:	56                   	push   %esi
  80153a:	e8 b8 f1 ff ff       	call   8006f7 <strlen>
  80153f:	83 c4 10             	add    $0x10,%esp
  801542:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  801547:	7f 6c                	jg     8015b5 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  801549:	83 ec 0c             	sub    $0xc,%esp
  80154c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80154f:	50                   	push   %eax
  801550:	e8 67 f8 ff ff       	call   800dbc <fd_alloc>
  801555:	89 c3                	mov    %eax,%ebx
  801557:	83 c4 10             	add    $0x10,%esp
  80155a:	85 c0                	test   %eax,%eax
  80155c:	78 3c                	js     80159a <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  80155e:	83 ec 08             	sub    $0x8,%esp
  801561:	56                   	push   %esi
  801562:	68 00 50 80 00       	push   $0x805000
  801567:	e8 ce f1 ff ff       	call   80073a <strcpy>
	fsipcbuf.open.req_omode = mode;
  80156c:	8b 45 0c             	mov    0xc(%ebp),%eax
  80156f:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  801574:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801577:	b8 01 00 00 00       	mov    $0x1,%eax
  80157c:	e8 db fd ff ff       	call   80135c <fsipc>
  801581:	89 c3                	mov    %eax,%ebx
  801583:	83 c4 10             	add    $0x10,%esp
  801586:	85 c0                	test   %eax,%eax
  801588:	78 19                	js     8015a3 <open+0x79>
	return fd2num(fd);
  80158a:	83 ec 0c             	sub    $0xc,%esp
  80158d:	ff 75 f4             	pushl  -0xc(%ebp)
  801590:	e8 f8 f7 ff ff       	call   800d8d <fd2num>
  801595:	89 c3                	mov    %eax,%ebx
  801597:	83 c4 10             	add    $0x10,%esp
}
  80159a:	89 d8                	mov    %ebx,%eax
  80159c:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80159f:	5b                   	pop    %ebx
  8015a0:	5e                   	pop    %esi
  8015a1:	5d                   	pop    %ebp
  8015a2:	c3                   	ret    
		fd_close(fd, 0);
  8015a3:	83 ec 08             	sub    $0x8,%esp
  8015a6:	6a 00                	push   $0x0
  8015a8:	ff 75 f4             	pushl  -0xc(%ebp)
  8015ab:	e8 10 f9 ff ff       	call   800ec0 <fd_close>
		return r;
  8015b0:	83 c4 10             	add    $0x10,%esp
  8015b3:	eb e5                	jmp    80159a <open+0x70>
		return -E_BAD_PATH;
  8015b5:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  8015ba:	eb de                	jmp    80159a <open+0x70>

008015bc <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  8015bc:	f3 0f 1e fb          	endbr32 
  8015c0:	55                   	push   %ebp
  8015c1:	89 e5                	mov    %esp,%ebp
  8015c3:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  8015c6:	ba 00 00 00 00       	mov    $0x0,%edx
  8015cb:	b8 08 00 00 00       	mov    $0x8,%eax
  8015d0:	e8 87 fd ff ff       	call   80135c <fsipc>
}
  8015d5:	c9                   	leave  
  8015d6:	c3                   	ret    

008015d7 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  8015d7:	f3 0f 1e fb          	endbr32 
  8015db:	55                   	push   %ebp
  8015dc:	89 e5                	mov    %esp,%ebp
  8015de:	56                   	push   %esi
  8015df:	53                   	push   %ebx
  8015e0:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  8015e3:	83 ec 0c             	sub    $0xc,%esp
  8015e6:	ff 75 08             	pushl  0x8(%ebp)
  8015e9:	e8 b3 f7 ff ff       	call   800da1 <fd2data>
  8015ee:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  8015f0:	83 c4 08             	add    $0x8,%esp
  8015f3:	68 eb 22 80 00       	push   $0x8022eb
  8015f8:	53                   	push   %ebx
  8015f9:	e8 3c f1 ff ff       	call   80073a <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  8015fe:	8b 46 04             	mov    0x4(%esi),%eax
  801601:	2b 06                	sub    (%esi),%eax
  801603:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  801609:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801610:	00 00 00 
	stat->st_dev = &devpipe;
  801613:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  80161a:	30 80 00 
	return 0;
}
  80161d:	b8 00 00 00 00       	mov    $0x0,%eax
  801622:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801625:	5b                   	pop    %ebx
  801626:	5e                   	pop    %esi
  801627:	5d                   	pop    %ebp
  801628:	c3                   	ret    

00801629 <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  801629:	f3 0f 1e fb          	endbr32 
  80162d:	55                   	push   %ebp
  80162e:	89 e5                	mov    %esp,%ebp
  801630:	53                   	push   %ebx
  801631:	83 ec 0c             	sub    $0xc,%esp
  801634:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  801637:	53                   	push   %ebx
  801638:	6a 00                	push   $0x0
  80163a:	e8 ca f5 ff ff       	call   800c09 <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  80163f:	89 1c 24             	mov    %ebx,(%esp)
  801642:	e8 5a f7 ff ff       	call   800da1 <fd2data>
  801647:	83 c4 08             	add    $0x8,%esp
  80164a:	50                   	push   %eax
  80164b:	6a 00                	push   $0x0
  80164d:	e8 b7 f5 ff ff       	call   800c09 <sys_page_unmap>
}
  801652:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801655:	c9                   	leave  
  801656:	c3                   	ret    

00801657 <_pipeisclosed>:
{
  801657:	55                   	push   %ebp
  801658:	89 e5                	mov    %esp,%ebp
  80165a:	57                   	push   %edi
  80165b:	56                   	push   %esi
  80165c:	53                   	push   %ebx
  80165d:	83 ec 1c             	sub    $0x1c,%esp
  801660:	89 c7                	mov    %eax,%edi
  801662:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  801664:	a1 04 40 80 00       	mov    0x804004,%eax
  801669:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  80166c:	83 ec 0c             	sub    $0xc,%esp
  80166f:	57                   	push   %edi
  801670:	e8 bd 05 00 00       	call   801c32 <pageref>
  801675:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801678:	89 34 24             	mov    %esi,(%esp)
  80167b:	e8 b2 05 00 00       	call   801c32 <pageref>
		nn = thisenv->env_runs;
  801680:	8b 15 04 40 80 00    	mov    0x804004,%edx
  801686:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  801689:	83 c4 10             	add    $0x10,%esp
  80168c:	39 cb                	cmp    %ecx,%ebx
  80168e:	74 1b                	je     8016ab <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  801690:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  801693:	75 cf                	jne    801664 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  801695:	8b 42 58             	mov    0x58(%edx),%eax
  801698:	6a 01                	push   $0x1
  80169a:	50                   	push   %eax
  80169b:	53                   	push   %ebx
  80169c:	68 f2 22 80 00       	push   $0x8022f2
  8016a1:	e8 bb ea ff ff       	call   800161 <cprintf>
  8016a6:	83 c4 10             	add    $0x10,%esp
  8016a9:	eb b9                	jmp    801664 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  8016ab:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8016ae:	0f 94 c0             	sete   %al
  8016b1:	0f b6 c0             	movzbl %al,%eax
}
  8016b4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8016b7:	5b                   	pop    %ebx
  8016b8:	5e                   	pop    %esi
  8016b9:	5f                   	pop    %edi
  8016ba:	5d                   	pop    %ebp
  8016bb:	c3                   	ret    

008016bc <devpipe_write>:
{
  8016bc:	f3 0f 1e fb          	endbr32 
  8016c0:	55                   	push   %ebp
  8016c1:	89 e5                	mov    %esp,%ebp
  8016c3:	57                   	push   %edi
  8016c4:	56                   	push   %esi
  8016c5:	53                   	push   %ebx
  8016c6:	83 ec 28             	sub    $0x28,%esp
  8016c9:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  8016cc:	56                   	push   %esi
  8016cd:	e8 cf f6 ff ff       	call   800da1 <fd2data>
  8016d2:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8016d4:	83 c4 10             	add    $0x10,%esp
  8016d7:	bf 00 00 00 00       	mov    $0x0,%edi
  8016dc:	3b 7d 10             	cmp    0x10(%ebp),%edi
  8016df:	74 4f                	je     801730 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  8016e1:	8b 43 04             	mov    0x4(%ebx),%eax
  8016e4:	8b 0b                	mov    (%ebx),%ecx
  8016e6:	8d 51 20             	lea    0x20(%ecx),%edx
  8016e9:	39 d0                	cmp    %edx,%eax
  8016eb:	72 14                	jb     801701 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  8016ed:	89 da                	mov    %ebx,%edx
  8016ef:	89 f0                	mov    %esi,%eax
  8016f1:	e8 61 ff ff ff       	call   801657 <_pipeisclosed>
  8016f6:	85 c0                	test   %eax,%eax
  8016f8:	75 3b                	jne    801735 <devpipe_write+0x79>
			sys_yield();
  8016fa:	e8 5a f4 ff ff       	call   800b59 <sys_yield>
  8016ff:	eb e0                	jmp    8016e1 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  801701:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801704:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  801708:	88 4d e7             	mov    %cl,-0x19(%ebp)
  80170b:	89 c2                	mov    %eax,%edx
  80170d:	c1 fa 1f             	sar    $0x1f,%edx
  801710:	89 d1                	mov    %edx,%ecx
  801712:	c1 e9 1b             	shr    $0x1b,%ecx
  801715:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  801718:	83 e2 1f             	and    $0x1f,%edx
  80171b:	29 ca                	sub    %ecx,%edx
  80171d:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  801721:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801725:	83 c0 01             	add    $0x1,%eax
  801728:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  80172b:	83 c7 01             	add    $0x1,%edi
  80172e:	eb ac                	jmp    8016dc <devpipe_write+0x20>
	return i;
  801730:	8b 45 10             	mov    0x10(%ebp),%eax
  801733:	eb 05                	jmp    80173a <devpipe_write+0x7e>
				return 0;
  801735:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80173a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80173d:	5b                   	pop    %ebx
  80173e:	5e                   	pop    %esi
  80173f:	5f                   	pop    %edi
  801740:	5d                   	pop    %ebp
  801741:	c3                   	ret    

00801742 <devpipe_read>:
{
  801742:	f3 0f 1e fb          	endbr32 
  801746:	55                   	push   %ebp
  801747:	89 e5                	mov    %esp,%ebp
  801749:	57                   	push   %edi
  80174a:	56                   	push   %esi
  80174b:	53                   	push   %ebx
  80174c:	83 ec 18             	sub    $0x18,%esp
  80174f:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  801752:	57                   	push   %edi
  801753:	e8 49 f6 ff ff       	call   800da1 <fd2data>
  801758:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  80175a:	83 c4 10             	add    $0x10,%esp
  80175d:	be 00 00 00 00       	mov    $0x0,%esi
  801762:	3b 75 10             	cmp    0x10(%ebp),%esi
  801765:	75 14                	jne    80177b <devpipe_read+0x39>
	return i;
  801767:	8b 45 10             	mov    0x10(%ebp),%eax
  80176a:	eb 02                	jmp    80176e <devpipe_read+0x2c>
				return i;
  80176c:	89 f0                	mov    %esi,%eax
}
  80176e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801771:	5b                   	pop    %ebx
  801772:	5e                   	pop    %esi
  801773:	5f                   	pop    %edi
  801774:	5d                   	pop    %ebp
  801775:	c3                   	ret    
			sys_yield();
  801776:	e8 de f3 ff ff       	call   800b59 <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  80177b:	8b 03                	mov    (%ebx),%eax
  80177d:	3b 43 04             	cmp    0x4(%ebx),%eax
  801780:	75 18                	jne    80179a <devpipe_read+0x58>
			if (i > 0)
  801782:	85 f6                	test   %esi,%esi
  801784:	75 e6                	jne    80176c <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  801786:	89 da                	mov    %ebx,%edx
  801788:	89 f8                	mov    %edi,%eax
  80178a:	e8 c8 fe ff ff       	call   801657 <_pipeisclosed>
  80178f:	85 c0                	test   %eax,%eax
  801791:	74 e3                	je     801776 <devpipe_read+0x34>
				return 0;
  801793:	b8 00 00 00 00       	mov    $0x0,%eax
  801798:	eb d4                	jmp    80176e <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  80179a:	99                   	cltd   
  80179b:	c1 ea 1b             	shr    $0x1b,%edx
  80179e:	01 d0                	add    %edx,%eax
  8017a0:	83 e0 1f             	and    $0x1f,%eax
  8017a3:	29 d0                	sub    %edx,%eax
  8017a5:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  8017aa:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8017ad:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  8017b0:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  8017b3:	83 c6 01             	add    $0x1,%esi
  8017b6:	eb aa                	jmp    801762 <devpipe_read+0x20>

008017b8 <pipe>:
{
  8017b8:	f3 0f 1e fb          	endbr32 
  8017bc:	55                   	push   %ebp
  8017bd:	89 e5                	mov    %esp,%ebp
  8017bf:	56                   	push   %esi
  8017c0:	53                   	push   %ebx
  8017c1:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  8017c4:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8017c7:	50                   	push   %eax
  8017c8:	e8 ef f5 ff ff       	call   800dbc <fd_alloc>
  8017cd:	89 c3                	mov    %eax,%ebx
  8017cf:	83 c4 10             	add    $0x10,%esp
  8017d2:	85 c0                	test   %eax,%eax
  8017d4:	0f 88 23 01 00 00    	js     8018fd <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8017da:	83 ec 04             	sub    $0x4,%esp
  8017dd:	68 07 04 00 00       	push   $0x407
  8017e2:	ff 75 f4             	pushl  -0xc(%ebp)
  8017e5:	6a 00                	push   $0x0
  8017e7:	e8 90 f3 ff ff       	call   800b7c <sys_page_alloc>
  8017ec:	89 c3                	mov    %eax,%ebx
  8017ee:	83 c4 10             	add    $0x10,%esp
  8017f1:	85 c0                	test   %eax,%eax
  8017f3:	0f 88 04 01 00 00    	js     8018fd <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  8017f9:	83 ec 0c             	sub    $0xc,%esp
  8017fc:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8017ff:	50                   	push   %eax
  801800:	e8 b7 f5 ff ff       	call   800dbc <fd_alloc>
  801805:	89 c3                	mov    %eax,%ebx
  801807:	83 c4 10             	add    $0x10,%esp
  80180a:	85 c0                	test   %eax,%eax
  80180c:	0f 88 db 00 00 00    	js     8018ed <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801812:	83 ec 04             	sub    $0x4,%esp
  801815:	68 07 04 00 00       	push   $0x407
  80181a:	ff 75 f0             	pushl  -0x10(%ebp)
  80181d:	6a 00                	push   $0x0
  80181f:	e8 58 f3 ff ff       	call   800b7c <sys_page_alloc>
  801824:	89 c3                	mov    %eax,%ebx
  801826:	83 c4 10             	add    $0x10,%esp
  801829:	85 c0                	test   %eax,%eax
  80182b:	0f 88 bc 00 00 00    	js     8018ed <pipe+0x135>
	va = fd2data(fd0);
  801831:	83 ec 0c             	sub    $0xc,%esp
  801834:	ff 75 f4             	pushl  -0xc(%ebp)
  801837:	e8 65 f5 ff ff       	call   800da1 <fd2data>
  80183c:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80183e:	83 c4 0c             	add    $0xc,%esp
  801841:	68 07 04 00 00       	push   $0x407
  801846:	50                   	push   %eax
  801847:	6a 00                	push   $0x0
  801849:	e8 2e f3 ff ff       	call   800b7c <sys_page_alloc>
  80184e:	89 c3                	mov    %eax,%ebx
  801850:	83 c4 10             	add    $0x10,%esp
  801853:	85 c0                	test   %eax,%eax
  801855:	0f 88 82 00 00 00    	js     8018dd <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80185b:	83 ec 0c             	sub    $0xc,%esp
  80185e:	ff 75 f0             	pushl  -0x10(%ebp)
  801861:	e8 3b f5 ff ff       	call   800da1 <fd2data>
  801866:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  80186d:	50                   	push   %eax
  80186e:	6a 00                	push   $0x0
  801870:	56                   	push   %esi
  801871:	6a 00                	push   $0x0
  801873:	e8 4b f3 ff ff       	call   800bc3 <sys_page_map>
  801878:	89 c3                	mov    %eax,%ebx
  80187a:	83 c4 20             	add    $0x20,%esp
  80187d:	85 c0                	test   %eax,%eax
  80187f:	78 4e                	js     8018cf <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  801881:	a1 20 30 80 00       	mov    0x803020,%eax
  801886:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801889:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  80188b:	8b 55 f4             	mov    -0xc(%ebp),%edx
  80188e:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  801895:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801898:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  80189a:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80189d:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  8018a4:	83 ec 0c             	sub    $0xc,%esp
  8018a7:	ff 75 f4             	pushl  -0xc(%ebp)
  8018aa:	e8 de f4 ff ff       	call   800d8d <fd2num>
  8018af:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018b2:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  8018b4:	83 c4 04             	add    $0x4,%esp
  8018b7:	ff 75 f0             	pushl  -0x10(%ebp)
  8018ba:	e8 ce f4 ff ff       	call   800d8d <fd2num>
  8018bf:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018c2:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  8018c5:	83 c4 10             	add    $0x10,%esp
  8018c8:	bb 00 00 00 00       	mov    $0x0,%ebx
  8018cd:	eb 2e                	jmp    8018fd <pipe+0x145>
	sys_page_unmap(0, va);
  8018cf:	83 ec 08             	sub    $0x8,%esp
  8018d2:	56                   	push   %esi
  8018d3:	6a 00                	push   $0x0
  8018d5:	e8 2f f3 ff ff       	call   800c09 <sys_page_unmap>
  8018da:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  8018dd:	83 ec 08             	sub    $0x8,%esp
  8018e0:	ff 75 f0             	pushl  -0x10(%ebp)
  8018e3:	6a 00                	push   $0x0
  8018e5:	e8 1f f3 ff ff       	call   800c09 <sys_page_unmap>
  8018ea:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  8018ed:	83 ec 08             	sub    $0x8,%esp
  8018f0:	ff 75 f4             	pushl  -0xc(%ebp)
  8018f3:	6a 00                	push   $0x0
  8018f5:	e8 0f f3 ff ff       	call   800c09 <sys_page_unmap>
  8018fa:	83 c4 10             	add    $0x10,%esp
}
  8018fd:	89 d8                	mov    %ebx,%eax
  8018ff:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801902:	5b                   	pop    %ebx
  801903:	5e                   	pop    %esi
  801904:	5d                   	pop    %ebp
  801905:	c3                   	ret    

00801906 <pipeisclosed>:
{
  801906:	f3 0f 1e fb          	endbr32 
  80190a:	55                   	push   %ebp
  80190b:	89 e5                	mov    %esp,%ebp
  80190d:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801910:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801913:	50                   	push   %eax
  801914:	ff 75 08             	pushl  0x8(%ebp)
  801917:	e8 f6 f4 ff ff       	call   800e12 <fd_lookup>
  80191c:	83 c4 10             	add    $0x10,%esp
  80191f:	85 c0                	test   %eax,%eax
  801921:	78 18                	js     80193b <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  801923:	83 ec 0c             	sub    $0xc,%esp
  801926:	ff 75 f4             	pushl  -0xc(%ebp)
  801929:	e8 73 f4 ff ff       	call   800da1 <fd2data>
  80192e:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801930:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801933:	e8 1f fd ff ff       	call   801657 <_pipeisclosed>
  801938:	83 c4 10             	add    $0x10,%esp
}
  80193b:	c9                   	leave  
  80193c:	c3                   	ret    

0080193d <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  80193d:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  801941:	b8 00 00 00 00       	mov    $0x0,%eax
  801946:	c3                   	ret    

00801947 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801947:	f3 0f 1e fb          	endbr32 
  80194b:	55                   	push   %ebp
  80194c:	89 e5                	mov    %esp,%ebp
  80194e:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  801951:	68 0a 23 80 00       	push   $0x80230a
  801956:	ff 75 0c             	pushl  0xc(%ebp)
  801959:	e8 dc ed ff ff       	call   80073a <strcpy>
	return 0;
}
  80195e:	b8 00 00 00 00       	mov    $0x0,%eax
  801963:	c9                   	leave  
  801964:	c3                   	ret    

00801965 <devcons_write>:
{
  801965:	f3 0f 1e fb          	endbr32 
  801969:	55                   	push   %ebp
  80196a:	89 e5                	mov    %esp,%ebp
  80196c:	57                   	push   %edi
  80196d:	56                   	push   %esi
  80196e:	53                   	push   %ebx
  80196f:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  801975:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  80197a:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  801980:	3b 75 10             	cmp    0x10(%ebp),%esi
  801983:	73 31                	jae    8019b6 <devcons_write+0x51>
		m = n - tot;
  801985:	8b 5d 10             	mov    0x10(%ebp),%ebx
  801988:	29 f3                	sub    %esi,%ebx
  80198a:	83 fb 7f             	cmp    $0x7f,%ebx
  80198d:	b8 7f 00 00 00       	mov    $0x7f,%eax
  801992:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  801995:	83 ec 04             	sub    $0x4,%esp
  801998:	53                   	push   %ebx
  801999:	89 f0                	mov    %esi,%eax
  80199b:	03 45 0c             	add    0xc(%ebp),%eax
  80199e:	50                   	push   %eax
  80199f:	57                   	push   %edi
  8019a0:	e8 4b ef ff ff       	call   8008f0 <memmove>
		sys_cputs(buf, m);
  8019a5:	83 c4 08             	add    $0x8,%esp
  8019a8:	53                   	push   %ebx
  8019a9:	57                   	push   %edi
  8019aa:	e8 fd f0 ff ff       	call   800aac <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  8019af:	01 de                	add    %ebx,%esi
  8019b1:	83 c4 10             	add    $0x10,%esp
  8019b4:	eb ca                	jmp    801980 <devcons_write+0x1b>
}
  8019b6:	89 f0                	mov    %esi,%eax
  8019b8:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8019bb:	5b                   	pop    %ebx
  8019bc:	5e                   	pop    %esi
  8019bd:	5f                   	pop    %edi
  8019be:	5d                   	pop    %ebp
  8019bf:	c3                   	ret    

008019c0 <devcons_read>:
{
  8019c0:	f3 0f 1e fb          	endbr32 
  8019c4:	55                   	push   %ebp
  8019c5:	89 e5                	mov    %esp,%ebp
  8019c7:	83 ec 08             	sub    $0x8,%esp
  8019ca:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  8019cf:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8019d3:	74 21                	je     8019f6 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  8019d5:	e8 f4 f0 ff ff       	call   800ace <sys_cgetc>
  8019da:	85 c0                	test   %eax,%eax
  8019dc:	75 07                	jne    8019e5 <devcons_read+0x25>
		sys_yield();
  8019de:	e8 76 f1 ff ff       	call   800b59 <sys_yield>
  8019e3:	eb f0                	jmp    8019d5 <devcons_read+0x15>
	if (c < 0)
  8019e5:	78 0f                	js     8019f6 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  8019e7:	83 f8 04             	cmp    $0x4,%eax
  8019ea:	74 0c                	je     8019f8 <devcons_read+0x38>
	*(char*)vbuf = c;
  8019ec:	8b 55 0c             	mov    0xc(%ebp),%edx
  8019ef:	88 02                	mov    %al,(%edx)
	return 1;
  8019f1:	b8 01 00 00 00       	mov    $0x1,%eax
}
  8019f6:	c9                   	leave  
  8019f7:	c3                   	ret    
		return 0;
  8019f8:	b8 00 00 00 00       	mov    $0x0,%eax
  8019fd:	eb f7                	jmp    8019f6 <devcons_read+0x36>

008019ff <cputchar>:
{
  8019ff:	f3 0f 1e fb          	endbr32 
  801a03:	55                   	push   %ebp
  801a04:	89 e5                	mov    %esp,%ebp
  801a06:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801a09:	8b 45 08             	mov    0x8(%ebp),%eax
  801a0c:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801a0f:	6a 01                	push   $0x1
  801a11:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a14:	50                   	push   %eax
  801a15:	e8 92 f0 ff ff       	call   800aac <sys_cputs>
}
  801a1a:	83 c4 10             	add    $0x10,%esp
  801a1d:	c9                   	leave  
  801a1e:	c3                   	ret    

00801a1f <getchar>:
{
  801a1f:	f3 0f 1e fb          	endbr32 
  801a23:	55                   	push   %ebp
  801a24:	89 e5                	mov    %esp,%ebp
  801a26:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801a29:	6a 01                	push   $0x1
  801a2b:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a2e:	50                   	push   %eax
  801a2f:	6a 00                	push   $0x0
  801a31:	e8 5f f6 ff ff       	call   801095 <read>
	if (r < 0)
  801a36:	83 c4 10             	add    $0x10,%esp
  801a39:	85 c0                	test   %eax,%eax
  801a3b:	78 06                	js     801a43 <getchar+0x24>
	if (r < 1)
  801a3d:	74 06                	je     801a45 <getchar+0x26>
	return c;
  801a3f:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801a43:	c9                   	leave  
  801a44:	c3                   	ret    
		return -E_EOF;
  801a45:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801a4a:	eb f7                	jmp    801a43 <getchar+0x24>

00801a4c <iscons>:
{
  801a4c:	f3 0f 1e fb          	endbr32 
  801a50:	55                   	push   %ebp
  801a51:	89 e5                	mov    %esp,%ebp
  801a53:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801a56:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a59:	50                   	push   %eax
  801a5a:	ff 75 08             	pushl  0x8(%ebp)
  801a5d:	e8 b0 f3 ff ff       	call   800e12 <fd_lookup>
  801a62:	83 c4 10             	add    $0x10,%esp
  801a65:	85 c0                	test   %eax,%eax
  801a67:	78 11                	js     801a7a <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801a69:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801a6c:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801a72:	39 10                	cmp    %edx,(%eax)
  801a74:	0f 94 c0             	sete   %al
  801a77:	0f b6 c0             	movzbl %al,%eax
}
  801a7a:	c9                   	leave  
  801a7b:	c3                   	ret    

00801a7c <opencons>:
{
  801a7c:	f3 0f 1e fb          	endbr32 
  801a80:	55                   	push   %ebp
  801a81:	89 e5                	mov    %esp,%ebp
  801a83:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801a86:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a89:	50                   	push   %eax
  801a8a:	e8 2d f3 ff ff       	call   800dbc <fd_alloc>
  801a8f:	83 c4 10             	add    $0x10,%esp
  801a92:	85 c0                	test   %eax,%eax
  801a94:	78 3a                	js     801ad0 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801a96:	83 ec 04             	sub    $0x4,%esp
  801a99:	68 07 04 00 00       	push   $0x407
  801a9e:	ff 75 f4             	pushl  -0xc(%ebp)
  801aa1:	6a 00                	push   $0x0
  801aa3:	e8 d4 f0 ff ff       	call   800b7c <sys_page_alloc>
  801aa8:	83 c4 10             	add    $0x10,%esp
  801aab:	85 c0                	test   %eax,%eax
  801aad:	78 21                	js     801ad0 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801aaf:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801ab2:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801ab8:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  801aba:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801abd:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801ac4:	83 ec 0c             	sub    $0xc,%esp
  801ac7:	50                   	push   %eax
  801ac8:	e8 c0 f2 ff ff       	call   800d8d <fd2num>
  801acd:	83 c4 10             	add    $0x10,%esp
}
  801ad0:	c9                   	leave  
  801ad1:	c3                   	ret    

00801ad2 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  801ad2:	f3 0f 1e fb          	endbr32 
  801ad6:	55                   	push   %ebp
  801ad7:	89 e5                	mov    %esp,%ebp
  801ad9:	56                   	push   %esi
  801ada:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  801adb:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  801ade:	8b 35 00 30 80 00    	mov    0x803000,%esi
  801ae4:	e8 4d f0 ff ff       	call   800b36 <sys_getenvid>
  801ae9:	83 ec 0c             	sub    $0xc,%esp
  801aec:	ff 75 0c             	pushl  0xc(%ebp)
  801aef:	ff 75 08             	pushl  0x8(%ebp)
  801af2:	56                   	push   %esi
  801af3:	50                   	push   %eax
  801af4:	68 18 23 80 00       	push   $0x802318
  801af9:	e8 63 e6 ff ff       	call   800161 <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  801afe:	83 c4 18             	add    $0x18,%esp
  801b01:	53                   	push   %ebx
  801b02:	ff 75 10             	pushl  0x10(%ebp)
  801b05:	e8 02 e6 ff ff       	call   80010c <vcprintf>
	cprintf("\n");
  801b0a:	c7 04 24 fc 1e 80 00 	movl   $0x801efc,(%esp)
  801b11:	e8 4b e6 ff ff       	call   800161 <cprintf>
  801b16:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  801b19:	cc                   	int3   
  801b1a:	eb fd                	jmp    801b19 <_panic+0x47>

00801b1c <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801b1c:	f3 0f 1e fb          	endbr32 
  801b20:	55                   	push   %ebp
  801b21:	89 e5                	mov    %esp,%ebp
  801b23:	56                   	push   %esi
  801b24:	53                   	push   %ebx
  801b25:	8b 75 08             	mov    0x8(%ebp),%esi
  801b28:	8b 45 0c             	mov    0xc(%ebp),%eax
  801b2b:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801b2e:	85 c0                	test   %eax,%eax
  801b30:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801b35:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801b38:	83 ec 0c             	sub    $0xc,%esp
  801b3b:	50                   	push   %eax
  801b3c:	e8 07 f2 ff ff       	call   800d48 <sys_ipc_recv>
  801b41:	83 c4 10             	add    $0x10,%esp
  801b44:	85 c0                	test   %eax,%eax
  801b46:	78 3f                	js     801b87 <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801b48:	e8 e9 ef ff ff       	call   800b36 <sys_getenvid>
  801b4d:	25 ff 03 00 00       	and    $0x3ff,%eax
  801b52:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801b55:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801b5b:	89 15 04 40 80 00    	mov    %edx,0x804004

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801b61:	85 f6                	test   %esi,%esi
  801b63:	74 05                	je     801b6a <ipc_recv+0x4e>
  801b65:	8b 42 74             	mov    0x74(%edx),%eax
  801b68:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801b6a:	85 db                	test   %ebx,%ebx
  801b6c:	74 0a                	je     801b78 <ipc_recv+0x5c>
  801b6e:	a1 04 40 80 00       	mov    0x804004,%eax
  801b73:	8b 40 78             	mov    0x78(%eax),%eax
  801b76:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801b78:	a1 04 40 80 00       	mov    0x804004,%eax
  801b7d:	8b 40 70             	mov    0x70(%eax),%eax
}
  801b80:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801b83:	5b                   	pop    %ebx
  801b84:	5e                   	pop    %esi
  801b85:	5d                   	pop    %ebp
  801b86:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801b87:	85 f6                	test   %esi,%esi
  801b89:	74 06                	je     801b91 <ipc_recv+0x75>
  801b8b:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801b91:	85 db                	test   %ebx,%ebx
  801b93:	74 eb                	je     801b80 <ipc_recv+0x64>
  801b95:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801b9b:	eb e3                	jmp    801b80 <ipc_recv+0x64>

00801b9d <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801b9d:	f3 0f 1e fb          	endbr32 
  801ba1:	55                   	push   %ebp
  801ba2:	89 e5                	mov    %esp,%ebp
  801ba4:	57                   	push   %edi
  801ba5:	56                   	push   %esi
  801ba6:	53                   	push   %ebx
  801ba7:	83 ec 0c             	sub    $0xc,%esp
  801baa:	8b 7d 08             	mov    0x8(%ebp),%edi
  801bad:	8b 75 0c             	mov    0xc(%ebp),%esi
  801bb0:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801bb3:	85 db                	test   %ebx,%ebx
  801bb5:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801bba:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801bbd:	ff 75 14             	pushl  0x14(%ebp)
  801bc0:	53                   	push   %ebx
  801bc1:	56                   	push   %esi
  801bc2:	57                   	push   %edi
  801bc3:	e8 59 f1 ff ff       	call   800d21 <sys_ipc_try_send>
  801bc8:	83 c4 10             	add    $0x10,%esp
  801bcb:	85 c0                	test   %eax,%eax
  801bcd:	79 1e                	jns    801bed <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801bcf:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801bd2:	75 07                	jne    801bdb <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801bd4:	e8 80 ef ff ff       	call   800b59 <sys_yield>
  801bd9:	eb e2                	jmp    801bbd <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801bdb:	50                   	push   %eax
  801bdc:	68 3b 23 80 00       	push   $0x80233b
  801be1:	6a 3b                	push   $0x3b
  801be3:	68 4f 23 80 00       	push   $0x80234f
  801be8:	e8 e5 fe ff ff       	call   801ad2 <_panic>
	}
}
  801bed:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801bf0:	5b                   	pop    %ebx
  801bf1:	5e                   	pop    %esi
  801bf2:	5f                   	pop    %edi
  801bf3:	5d                   	pop    %ebp
  801bf4:	c3                   	ret    

00801bf5 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801bf5:	f3 0f 1e fb          	endbr32 
  801bf9:	55                   	push   %ebp
  801bfa:	89 e5                	mov    %esp,%ebp
  801bfc:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801bff:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801c04:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801c07:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801c0d:	8b 52 50             	mov    0x50(%edx),%edx
  801c10:	39 ca                	cmp    %ecx,%edx
  801c12:	74 11                	je     801c25 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801c14:	83 c0 01             	add    $0x1,%eax
  801c17:	3d 00 04 00 00       	cmp    $0x400,%eax
  801c1c:	75 e6                	jne    801c04 <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801c1e:	b8 00 00 00 00       	mov    $0x0,%eax
  801c23:	eb 0b                	jmp    801c30 <ipc_find_env+0x3b>
			return envs[i].env_id;
  801c25:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801c28:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801c2d:	8b 40 48             	mov    0x48(%eax),%eax
}
  801c30:	5d                   	pop    %ebp
  801c31:	c3                   	ret    

00801c32 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801c32:	f3 0f 1e fb          	endbr32 
  801c36:	55                   	push   %ebp
  801c37:	89 e5                	mov    %esp,%ebp
  801c39:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801c3c:	89 c2                	mov    %eax,%edx
  801c3e:	c1 ea 16             	shr    $0x16,%edx
  801c41:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801c48:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801c4d:	f6 c1 01             	test   $0x1,%cl
  801c50:	74 1c                	je     801c6e <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801c52:	c1 e8 0c             	shr    $0xc,%eax
  801c55:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801c5c:	a8 01                	test   $0x1,%al
  801c5e:	74 0e                	je     801c6e <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801c60:	c1 e8 0c             	shr    $0xc,%eax
  801c63:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801c6a:	ef 
  801c6b:	0f b7 d2             	movzwl %dx,%edx
}
  801c6e:	89 d0                	mov    %edx,%eax
  801c70:	5d                   	pop    %ebp
  801c71:	c3                   	ret    
  801c72:	66 90                	xchg   %ax,%ax
  801c74:	66 90                	xchg   %ax,%ax
  801c76:	66 90                	xchg   %ax,%ax
  801c78:	66 90                	xchg   %ax,%ax
  801c7a:	66 90                	xchg   %ax,%ax
  801c7c:	66 90                	xchg   %ax,%ax
  801c7e:	66 90                	xchg   %ax,%ax

00801c80 <__udivdi3>:
  801c80:	f3 0f 1e fb          	endbr32 
  801c84:	55                   	push   %ebp
  801c85:	57                   	push   %edi
  801c86:	56                   	push   %esi
  801c87:	53                   	push   %ebx
  801c88:	83 ec 1c             	sub    $0x1c,%esp
  801c8b:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801c8f:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801c93:	8b 74 24 34          	mov    0x34(%esp),%esi
  801c97:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801c9b:	85 d2                	test   %edx,%edx
  801c9d:	75 19                	jne    801cb8 <__udivdi3+0x38>
  801c9f:	39 f3                	cmp    %esi,%ebx
  801ca1:	76 4d                	jbe    801cf0 <__udivdi3+0x70>
  801ca3:	31 ff                	xor    %edi,%edi
  801ca5:	89 e8                	mov    %ebp,%eax
  801ca7:	89 f2                	mov    %esi,%edx
  801ca9:	f7 f3                	div    %ebx
  801cab:	89 fa                	mov    %edi,%edx
  801cad:	83 c4 1c             	add    $0x1c,%esp
  801cb0:	5b                   	pop    %ebx
  801cb1:	5e                   	pop    %esi
  801cb2:	5f                   	pop    %edi
  801cb3:	5d                   	pop    %ebp
  801cb4:	c3                   	ret    
  801cb5:	8d 76 00             	lea    0x0(%esi),%esi
  801cb8:	39 f2                	cmp    %esi,%edx
  801cba:	76 14                	jbe    801cd0 <__udivdi3+0x50>
  801cbc:	31 ff                	xor    %edi,%edi
  801cbe:	31 c0                	xor    %eax,%eax
  801cc0:	89 fa                	mov    %edi,%edx
  801cc2:	83 c4 1c             	add    $0x1c,%esp
  801cc5:	5b                   	pop    %ebx
  801cc6:	5e                   	pop    %esi
  801cc7:	5f                   	pop    %edi
  801cc8:	5d                   	pop    %ebp
  801cc9:	c3                   	ret    
  801cca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801cd0:	0f bd fa             	bsr    %edx,%edi
  801cd3:	83 f7 1f             	xor    $0x1f,%edi
  801cd6:	75 48                	jne    801d20 <__udivdi3+0xa0>
  801cd8:	39 f2                	cmp    %esi,%edx
  801cda:	72 06                	jb     801ce2 <__udivdi3+0x62>
  801cdc:	31 c0                	xor    %eax,%eax
  801cde:	39 eb                	cmp    %ebp,%ebx
  801ce0:	77 de                	ja     801cc0 <__udivdi3+0x40>
  801ce2:	b8 01 00 00 00       	mov    $0x1,%eax
  801ce7:	eb d7                	jmp    801cc0 <__udivdi3+0x40>
  801ce9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801cf0:	89 d9                	mov    %ebx,%ecx
  801cf2:	85 db                	test   %ebx,%ebx
  801cf4:	75 0b                	jne    801d01 <__udivdi3+0x81>
  801cf6:	b8 01 00 00 00       	mov    $0x1,%eax
  801cfb:	31 d2                	xor    %edx,%edx
  801cfd:	f7 f3                	div    %ebx
  801cff:	89 c1                	mov    %eax,%ecx
  801d01:	31 d2                	xor    %edx,%edx
  801d03:	89 f0                	mov    %esi,%eax
  801d05:	f7 f1                	div    %ecx
  801d07:	89 c6                	mov    %eax,%esi
  801d09:	89 e8                	mov    %ebp,%eax
  801d0b:	89 f7                	mov    %esi,%edi
  801d0d:	f7 f1                	div    %ecx
  801d0f:	89 fa                	mov    %edi,%edx
  801d11:	83 c4 1c             	add    $0x1c,%esp
  801d14:	5b                   	pop    %ebx
  801d15:	5e                   	pop    %esi
  801d16:	5f                   	pop    %edi
  801d17:	5d                   	pop    %ebp
  801d18:	c3                   	ret    
  801d19:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d20:	89 f9                	mov    %edi,%ecx
  801d22:	b8 20 00 00 00       	mov    $0x20,%eax
  801d27:	29 f8                	sub    %edi,%eax
  801d29:	d3 e2                	shl    %cl,%edx
  801d2b:	89 54 24 08          	mov    %edx,0x8(%esp)
  801d2f:	89 c1                	mov    %eax,%ecx
  801d31:	89 da                	mov    %ebx,%edx
  801d33:	d3 ea                	shr    %cl,%edx
  801d35:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801d39:	09 d1                	or     %edx,%ecx
  801d3b:	89 f2                	mov    %esi,%edx
  801d3d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801d41:	89 f9                	mov    %edi,%ecx
  801d43:	d3 e3                	shl    %cl,%ebx
  801d45:	89 c1                	mov    %eax,%ecx
  801d47:	d3 ea                	shr    %cl,%edx
  801d49:	89 f9                	mov    %edi,%ecx
  801d4b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801d4f:	89 eb                	mov    %ebp,%ebx
  801d51:	d3 e6                	shl    %cl,%esi
  801d53:	89 c1                	mov    %eax,%ecx
  801d55:	d3 eb                	shr    %cl,%ebx
  801d57:	09 de                	or     %ebx,%esi
  801d59:	89 f0                	mov    %esi,%eax
  801d5b:	f7 74 24 08          	divl   0x8(%esp)
  801d5f:	89 d6                	mov    %edx,%esi
  801d61:	89 c3                	mov    %eax,%ebx
  801d63:	f7 64 24 0c          	mull   0xc(%esp)
  801d67:	39 d6                	cmp    %edx,%esi
  801d69:	72 15                	jb     801d80 <__udivdi3+0x100>
  801d6b:	89 f9                	mov    %edi,%ecx
  801d6d:	d3 e5                	shl    %cl,%ebp
  801d6f:	39 c5                	cmp    %eax,%ebp
  801d71:	73 04                	jae    801d77 <__udivdi3+0xf7>
  801d73:	39 d6                	cmp    %edx,%esi
  801d75:	74 09                	je     801d80 <__udivdi3+0x100>
  801d77:	89 d8                	mov    %ebx,%eax
  801d79:	31 ff                	xor    %edi,%edi
  801d7b:	e9 40 ff ff ff       	jmp    801cc0 <__udivdi3+0x40>
  801d80:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801d83:	31 ff                	xor    %edi,%edi
  801d85:	e9 36 ff ff ff       	jmp    801cc0 <__udivdi3+0x40>
  801d8a:	66 90                	xchg   %ax,%ax
  801d8c:	66 90                	xchg   %ax,%ax
  801d8e:	66 90                	xchg   %ax,%ax

00801d90 <__umoddi3>:
  801d90:	f3 0f 1e fb          	endbr32 
  801d94:	55                   	push   %ebp
  801d95:	57                   	push   %edi
  801d96:	56                   	push   %esi
  801d97:	53                   	push   %ebx
  801d98:	83 ec 1c             	sub    $0x1c,%esp
  801d9b:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801d9f:	8b 74 24 30          	mov    0x30(%esp),%esi
  801da3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801da7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801dab:	85 c0                	test   %eax,%eax
  801dad:	75 19                	jne    801dc8 <__umoddi3+0x38>
  801daf:	39 df                	cmp    %ebx,%edi
  801db1:	76 5d                	jbe    801e10 <__umoddi3+0x80>
  801db3:	89 f0                	mov    %esi,%eax
  801db5:	89 da                	mov    %ebx,%edx
  801db7:	f7 f7                	div    %edi
  801db9:	89 d0                	mov    %edx,%eax
  801dbb:	31 d2                	xor    %edx,%edx
  801dbd:	83 c4 1c             	add    $0x1c,%esp
  801dc0:	5b                   	pop    %ebx
  801dc1:	5e                   	pop    %esi
  801dc2:	5f                   	pop    %edi
  801dc3:	5d                   	pop    %ebp
  801dc4:	c3                   	ret    
  801dc5:	8d 76 00             	lea    0x0(%esi),%esi
  801dc8:	89 f2                	mov    %esi,%edx
  801dca:	39 d8                	cmp    %ebx,%eax
  801dcc:	76 12                	jbe    801de0 <__umoddi3+0x50>
  801dce:	89 f0                	mov    %esi,%eax
  801dd0:	89 da                	mov    %ebx,%edx
  801dd2:	83 c4 1c             	add    $0x1c,%esp
  801dd5:	5b                   	pop    %ebx
  801dd6:	5e                   	pop    %esi
  801dd7:	5f                   	pop    %edi
  801dd8:	5d                   	pop    %ebp
  801dd9:	c3                   	ret    
  801dda:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801de0:	0f bd e8             	bsr    %eax,%ebp
  801de3:	83 f5 1f             	xor    $0x1f,%ebp
  801de6:	75 50                	jne    801e38 <__umoddi3+0xa8>
  801de8:	39 d8                	cmp    %ebx,%eax
  801dea:	0f 82 e0 00 00 00    	jb     801ed0 <__umoddi3+0x140>
  801df0:	89 d9                	mov    %ebx,%ecx
  801df2:	39 f7                	cmp    %esi,%edi
  801df4:	0f 86 d6 00 00 00    	jbe    801ed0 <__umoddi3+0x140>
  801dfa:	89 d0                	mov    %edx,%eax
  801dfc:	89 ca                	mov    %ecx,%edx
  801dfe:	83 c4 1c             	add    $0x1c,%esp
  801e01:	5b                   	pop    %ebx
  801e02:	5e                   	pop    %esi
  801e03:	5f                   	pop    %edi
  801e04:	5d                   	pop    %ebp
  801e05:	c3                   	ret    
  801e06:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e0d:	8d 76 00             	lea    0x0(%esi),%esi
  801e10:	89 fd                	mov    %edi,%ebp
  801e12:	85 ff                	test   %edi,%edi
  801e14:	75 0b                	jne    801e21 <__umoddi3+0x91>
  801e16:	b8 01 00 00 00       	mov    $0x1,%eax
  801e1b:	31 d2                	xor    %edx,%edx
  801e1d:	f7 f7                	div    %edi
  801e1f:	89 c5                	mov    %eax,%ebp
  801e21:	89 d8                	mov    %ebx,%eax
  801e23:	31 d2                	xor    %edx,%edx
  801e25:	f7 f5                	div    %ebp
  801e27:	89 f0                	mov    %esi,%eax
  801e29:	f7 f5                	div    %ebp
  801e2b:	89 d0                	mov    %edx,%eax
  801e2d:	31 d2                	xor    %edx,%edx
  801e2f:	eb 8c                	jmp    801dbd <__umoddi3+0x2d>
  801e31:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e38:	89 e9                	mov    %ebp,%ecx
  801e3a:	ba 20 00 00 00       	mov    $0x20,%edx
  801e3f:	29 ea                	sub    %ebp,%edx
  801e41:	d3 e0                	shl    %cl,%eax
  801e43:	89 44 24 08          	mov    %eax,0x8(%esp)
  801e47:	89 d1                	mov    %edx,%ecx
  801e49:	89 f8                	mov    %edi,%eax
  801e4b:	d3 e8                	shr    %cl,%eax
  801e4d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801e51:	89 54 24 04          	mov    %edx,0x4(%esp)
  801e55:	8b 54 24 04          	mov    0x4(%esp),%edx
  801e59:	09 c1                	or     %eax,%ecx
  801e5b:	89 d8                	mov    %ebx,%eax
  801e5d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801e61:	89 e9                	mov    %ebp,%ecx
  801e63:	d3 e7                	shl    %cl,%edi
  801e65:	89 d1                	mov    %edx,%ecx
  801e67:	d3 e8                	shr    %cl,%eax
  801e69:	89 e9                	mov    %ebp,%ecx
  801e6b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801e6f:	d3 e3                	shl    %cl,%ebx
  801e71:	89 c7                	mov    %eax,%edi
  801e73:	89 d1                	mov    %edx,%ecx
  801e75:	89 f0                	mov    %esi,%eax
  801e77:	d3 e8                	shr    %cl,%eax
  801e79:	89 e9                	mov    %ebp,%ecx
  801e7b:	89 fa                	mov    %edi,%edx
  801e7d:	d3 e6                	shl    %cl,%esi
  801e7f:	09 d8                	or     %ebx,%eax
  801e81:	f7 74 24 08          	divl   0x8(%esp)
  801e85:	89 d1                	mov    %edx,%ecx
  801e87:	89 f3                	mov    %esi,%ebx
  801e89:	f7 64 24 0c          	mull   0xc(%esp)
  801e8d:	89 c6                	mov    %eax,%esi
  801e8f:	89 d7                	mov    %edx,%edi
  801e91:	39 d1                	cmp    %edx,%ecx
  801e93:	72 06                	jb     801e9b <__umoddi3+0x10b>
  801e95:	75 10                	jne    801ea7 <__umoddi3+0x117>
  801e97:	39 c3                	cmp    %eax,%ebx
  801e99:	73 0c                	jae    801ea7 <__umoddi3+0x117>
  801e9b:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801e9f:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801ea3:	89 d7                	mov    %edx,%edi
  801ea5:	89 c6                	mov    %eax,%esi
  801ea7:	89 ca                	mov    %ecx,%edx
  801ea9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801eae:	29 f3                	sub    %esi,%ebx
  801eb0:	19 fa                	sbb    %edi,%edx
  801eb2:	89 d0                	mov    %edx,%eax
  801eb4:	d3 e0                	shl    %cl,%eax
  801eb6:	89 e9                	mov    %ebp,%ecx
  801eb8:	d3 eb                	shr    %cl,%ebx
  801eba:	d3 ea                	shr    %cl,%edx
  801ebc:	09 d8                	or     %ebx,%eax
  801ebe:	83 c4 1c             	add    $0x1c,%esp
  801ec1:	5b                   	pop    %ebx
  801ec2:	5e                   	pop    %esi
  801ec3:	5f                   	pop    %edi
  801ec4:	5d                   	pop    %ebp
  801ec5:	c3                   	ret    
  801ec6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801ecd:	8d 76 00             	lea    0x0(%esi),%esi
  801ed0:	29 fe                	sub    %edi,%esi
  801ed2:	19 c3                	sbb    %eax,%ebx
  801ed4:	89 f2                	mov    %esi,%edx
  801ed6:	89 d9                	mov    %ebx,%ecx
  801ed8:	e9 1d ff ff ff       	jmp    801dfa <__umoddi3+0x6a>
